## Converting a data.frame to a numerical matrix in R, not so easy!

Sometimes you need to use a function that wants a numeric matrix as input. One such function is glmnet.cv() which performs lasso regression with cross validation, which is very cool. Unfortunately, it is picky about how it wants the input data. Here’s some lines of my code: fit_cv = cv.glmnet(x = as.matrix(temp_df[predictors]), #predictor vars matrix […]