We assign "Female" first when setting the levels:
levels(factor_survey_vector) <- c("Female", "Male")
but "male" is the first factor:
male <- factor_survey_vector[1]
This is because the first element of survey_vector is "M" Could this behavior be made clearer somehow?
https://campus.datacamp.com/courses/free-introduction-to-r/chapter-4-factors-4?ex=6
We assign "Female" first when setting the levels:
levels(factor_survey_vector) <- c("Female", "Male")
but "male" is the first factor:male <- factor_survey_vector[1]
This is because the first element of
survey_vector
is "M" Could this behavior be made clearer somehow?