0

I recently installed R version 4.0.1 (Nickname:See Things Now) on my new laptop and it isnt analysing my data properly. However the same codes with the same data analysed in version 3.6.1 (Nickname: Action of the Toes) on another laptop gives me the appropriate results. I would appreciate an explanation for this.

Example: "summary(CamelinaSeed$Type)" gives the output in version 4.0.1 Length Class Mode 37522 character character

With version 3.6.1: "summary(CamelinaSeed$Type)" : Camelina Microcarpa Camelina Sativa 1050 36472

Phil
  • 7,287
  • 3
  • 36
  • 66
Emmy
  • 1
  • 1
    The big change between R ver 3 vs R ver 4 is the default behavior when creating dataframes. In R ver 4 the behavior will convert strings into a character object while in previous versions the default is was to convert strings into factors. – Dave2e Jun 23 '20 at 18:41
  • How do i set it to convert strings into factors please? Cheers – Emmy Jun 23 '20 at 18:44
  • In the data.frame function you could use `stringsAsFactors=TRUE` or convert the columns manually with the factor/as.factor functions – Dave2e Jun 23 '20 at 18:47
  • 1
    See [R now uses a stringsAsFactors = FALSE default](https://cran.r-project.org/doc/manuals/r-devel/NEWS.html) – Waldi Jun 23 '20 at 18:50
  • Thanks Dave, this worked. – Emmy Jun 23 '20 at 18:58

0 Answers0