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:

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:

How to replace a substring of a string

You need to use return value of replaceAll() method. replaceAll() does not replace the characters in the current string, it returns a new string with replacement. String objects are immutable, their values cannot be changed after they are created. You may use replace() instead of replaceAll() if you don’t need regex. outputs