I am experiencing the same error as raised and answered here (cv.glm variable lengths differ) and in various other threads. Despite using the "correct" formula structure as suggested in all these threads, the error persists:
mod <- glm(Y ~ Var_1, data = df, family = binomial)
cv.glm(df, mod, K=8)
Error in model.frame.default(formula = Y ~ Var_1, data = list( : variable lengths differ (found for 'Var1')
Are there any other known sources of this issue?