0

the variable "weekend" should be in factor instead of character. Manually we can changed it to factor by factor(). The problem is how to make sure its read the variable as factor by default

  • 4
    You should take a look at the [NEWS file](https://cran.r-project.org/doc/manuals/r-release/NEWS.html), which lists the changes that occur in each new R version. In particular, you might note that before R 4.0.0, the old behavior was that the default value of the `stringsAsFactors` option was `TRUE`, but as of R 4.0.0, the default value of `stringsAsFactors` is now `FALSE`. This has been a widely celebrated change actually, but if you don't like it you can use `options(stringsAsFactors = TRUE)` – duckmayr Jun 16 '20 at 03:30

1 Answers1

0

From what I now, you have two options:

  1. Set options(stringsAsFactors = TRUE) at every start of your R scripts.
  2. Set options(stringsAsFactors = TRUE) on your .Rprofile
Basil Eric Rabi
  • 313
  • 1
  • 7