0

So R studio used to automatic convert character variables into factor variables, which is what i want. But now, it stopped doing that. How do i turn this on again? enter image description here

As you can see, the "Winery" variable is set to chr, were as before when i loaded the same dataset, R studio would turn it into a factor variable. I know that you can force them into a factor variable yourself, but the automatic solution is just much more convenient. enter image description here

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
Jake Long
  • 25
  • 6
  • 4
    I suspect you've recently upgraded to R v4. This is a change in the behaviour of `stringsAsFactors`. – Limey Mar 26 '21 at 11:36
  • 2
    Rstudio is not guilty here : this is the case in the newer versions of R (> 4.0.0), the option `stringsAsFactors` is now by default set to `FALSE`. See https://cran.r-project.org/doc/manuals/r-release/NEWS.html (in the section dédicated to R version 4.0.0) – Vincent Guillemot Mar 26 '21 at 11:37
  • 3
    Do you *need* them to be factors? The change was made in R 4.0 because, as a matter of fact, for most applications having character strings is just as appropriate as, or *more* appropriate than, factors. – Konrad Rudolph Mar 26 '21 at 11:38

0 Answers0