datacarpentry/r-intro-geospatial

Lesson Contribution - Solution to Challenge 3

Talishask opened this issue · 2 comments

I'm a member of The Carpentries staff and I'm submitting this issue on behalf of another member of the community. In most cases I won't be able to follow up or provide more details other that what I'm providing below.


The lesson is
Data carpentry: Geospatial Data Curriculum: Introduction to R for Geospatial Data: Data Structures: Solution to Challenge 3:
nordic <- read.csv(file="data/nordic-data.csv", colClasses=c(NA, NA, "character"))
str(nordic$country)

It (colClasses code) should be as follows.
nordic <- read.csv(file="data/nordic-data.csv", colClasses=c("character", NA, NA))
str(nordic$country)
Because, in the original nordic csv file, the countries are mentioned in the 1st column which is the only factor in the dataset. The code mention in the lesson will maintain the third column (lifeExp) as a character (not the country column).

Thanks for the proposed solution - let me check this out and integrate it in the near future

The current code in this lesson doesn't use the colClasses argument in its calls to read.csv().