Error while trying glmnet() in R: "Error in storage.mode(xd) <- "double" : 'list' object cannot be coerced to type 'double'"
Glmnet requires a matrix as input for both, $X$ and $y$. So you need to define as.matrix() on all model inputs.
For further examples also see the Glmnet Vignette by Trevor Hastie and Junyang Qian.