Consider the following R code (which should be a standard exercise):
library(dplyr)
library(smurf)
library(glmnet)
library(grpreg)
data("rent", package = "catdata")
rent$quality <- as.factor(rent$good + 2 * rent$best)
levels(rent$quality) <- c("fair", "good", "excellent")
formu <- rent ~ p(size, pen="lasso") +
p(rooms, pen="lasso") +
p(year, pen="lasso") +
p(quality, pen="lasso")
munich.fit.cv <- glmsmurf(formula = formu,
family = gaussian(),
data = rent,
pen.weights = "glm.stand",
lambda = "cv.mse")
What I get upon execution of the last statement is
Error in storage.mode(xd) <- "double" :
no method for coercing this S4 class to a vector
What's the issue? This code is basically copied from a source which claimed it to be working...