Any changes?
Consider the code below that loads data in swimming_pools.csv in two distinct ways:
# Option A
pools <- read.csv("swimming_pools.csv", stringsAsFactors = TRUE)
# Option B
pools <- read.csv("swimming_pools.csv", stringsAsFactors = FALSE)
How many variables in the resulting pools data frame have different types if you specify the stringsAsFactors argument differently?
The swimming_pools.csv file is available in your current working directory so you can experiment in the console.
This exercise is part of the course
Importing Data in R (Part 1)
Exercise instructions
Just one:
Name.,Two variables: Name and Address.,Three columns: all but Longitude.,All four of them!Hands-on interactive exercise
Turn theory into action with one of our interactive exercises
Start Exercise