BEPAS 2.6 Factor vectors

Use the function levels() or str() to look at the structure of the variable gender (within the BEPAS dataset).

Which statement is correct?

  1. The variable gender is a factor variable within the data frame BEPAS. The levels are “male” (first level) and “female” (second level).
  2. The variable gender is a factor variable within the data frame BEPAS. The levels are “female” (first level) and “male” (second level).
  3. The variable gender is a character variable within the tibble BEPAS.
  4. The variable gender is a character variable within the data frame BEPAS.

(Type the number of the correct statement)