Error in glm() in R

You can’t have factor/categorical response variables. Illustration: If you really want to do a logistic regression you should change them to 0 and 1, or FALSE and TRUE, and use family=binomial:

Logistic regression – eval(family$initialize) : y values must be 0 <= y <= 1

You added the as.factor(dataCancer$Classification) in the script, but even if the dataset dataCancer is attached, a command like the one above does not transform the dataset variable Classification into a factor. It only returns a factor on the console. Since you want to fit the model on the training dataset, you either specify or use the as.factor function in the glm line code