I hit an error ("unique() applies only to vectors") when trying to run cv.biglasso on a numeric response.
if (fit$family == "binomial" & (min(table(y)) > nfolds)) is not short circuiting when fit$family is gaussian and thus table(y) is being called regardless of family.
I hit an error ("unique() applies only to vectors") when trying to run cv.biglasso on a numeric response.
if (fit$family == "binomial" & (min(table(y)) > nfolds))
is not short circuiting whenfit$family
isgaussian
and thustable(y)
is being called regardless of family.Changing
&
to&&
should take care of the error.