Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Reading from a file
7. Converting factors – the stringsAsFactors option
Reading from an Excel file


As you see, all strings in this report are stored as factors. R automatically does this when reading a file into memory. Sometimes we want strings as factors, but not here. This would make every employee name a level of the variable first_name or last_name. We can fix this by adding another option to the read command: stringsAsFactors. It looks like this:

report_thunderrock <- read.table(
  sep = ";",
  header = TRUE,
  stringsAsFactors = FALSE)


Amend the template code, so it won't read in strings as factors.