Entering edit mode
                    12 months ago
        nuorain
        
    
        ▴
    
    40
    Hi, I believe here is better than ChatGPT. Please help me out with this error. Thank you very much. Best,
> library(Matrix)
> library(glmnet)
> set.seed(50)
> M1_1<-cv.glmnet(as.matrix(data[,-1]),data[,1] ,family = 'binomial',alpha = 1,nfolds = 
+                   10,type.measure = 'class')
Error in glmnet(x, y, weights = weights, offset = offset, lambda = lambda,  : 
  x has missing values; consider using makeX() to impute them
> 
The error tells you what's wrong and how to fix it. I'm tempted to mark this as spam.