Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The origin of feline-data_v2.csv not specified #717

Open
agboch opened this issue May 31, 2021 · 5 comments
Open

The origin of feline-data_v2.csv not specified #717

agboch opened this issue May 31, 2021 · 5 comments
Labels
help wanted Looking for Contributors type:clarification Suggest change for make lesson clearer type:documentation Issue about auxiliary files

Comments

@agboch
Copy link

agboch commented May 31, 2021

In Data Structures -> Data Types section of the lesson (https://swcarpentry.github.io/r-novice-gapminder/04-data-structures-part1/index.html), right before the feline-data_v2.csv is loaded, it says in the instructions: "A user has added details of another cat. This information is in the file data/feline-data_v2.csv." It is unclear whether it should be the instructor that should add these details and create the file beforehand? The file is not a part of the gapminder dataset used along with the lesson.

@jcoliver
Copy link
Contributor

jcoliver commented Jun 1, 2021

Good point, @agboch . This is something the instructor would need to setup before hand; including information in the Instructor Notes (https://github.com/swcarpentry/r-novice-gapminder/blob/main/_extras/guide.md) would be appropriate to address this issue. I think there might be long-term revisions to the lesson that make feline-data_v2.csv obsolete, but those are still a little ways off.

@jcoliver jcoliver added help wanted Looking for Contributors type:documentation Issue about auxiliary files labels Jun 1, 2021
@worcjamessmith
Copy link
Contributor

I also came across this problem. Additionally (and unsure if this should be a new issue or the same one), when I try to create the data to look like the data shown in the lesson, I get a different error when trying to operate on the weight column:

cats <- data.frame(coat = c("calico", "black", "tabby", "tabby"), weight = c(2.1, 5.0, 3.2, "2.3 or 2.4"), likes_string = c(1, 0, 1, 1))
cats$weight + 2
# returns this error: Error in cats$weight + 2 : non-numeric argument to binary operator
# this is because 
typeof(cats$weight) 
# is character not integer as stated in the lesson

Is this is a problem with my set up or with the episode content?

@jcoliver
Copy link
Contributor

jcoliver commented Jun 7, 2021

Thanks, @worcjamessmith . The behavior is different because it looks like you did something different - the example in the episode reads the data in from a file, setting stringsAsFactors = TRUE, resulting in the weight column being read in as a factor. In the example you present above, the weight column is typed as a string. I suspect if you try to replicate the episode (reading the data from a file with stringsAsFactors = TRUE), you should see the same warning as presented in the episode.

@NadineBestard
Copy link

I also noticed this v2 feline that did not match with the rest of the lesson. I presonally edited the first file manually in front of the students, as later it says "For now let's remove the extra line and reload it" and I thought that was making reference to the file. However, I don't think this is the best way, as the students also tried to edit the file and reload and then edit back like before. So much editing is error prone.

@rasundsbak
Copy link

suggested partly solution:

cats2 <- data.frame(coat = c("calico","black","tabby","tabby"),
weight = c(2.1, 5.0, 3.2, 2.3),
likes_string = c(1, 0, 1, 3))

write.csv(x=cats2, file = "data/feline-data_v2.csv", row.names = FALSE)

@naupaka naupaka added the type:clarification Suggest change for make lesson clearer label Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Looking for Contributors type:clarification Suggest change for make lesson clearer type:documentation Issue about auxiliary files
Projects
None yet
Development

No branches or pull requests

6 participants