R error in glmnet: NA/NaN/Inf in foreign function call
It appears that glmnet cannot handle NA values!
Addition: In case that you get this error without having NA's in your dataframe, you probably haven't defined your input matrix with the model.matrix function.
x <- model.matrix( ~ ., Data)
I know it is not the answer to your question but i had the same error as you and found this solution. So it might be helpful for others.