Closed sarakyeo closed 1 year ago
Thank you very much for noticing this @sarakyeo! This is very helpful.
We probably missed this when we updated various parts of the lesson to use characters instead of factors in order to match the new default behaviour in R >= 4.0.0 (where stringsAsFactors
is no longer TRUE
by default when loading data or building data frames).
It turns out there is currently an open PR (#829) related to that, which is nice timing :smiley: We will close this issue if the PR solves it adequately.
Solved by merging PR #829. Thank you @sarakyeo and @hannaheow!
I selected the Exploring Data Frames episode for my Carpentries Instructor Training teaching demonstration. As I was preparing for the participatory live coding, I noticed that adding the object
newRow
to thecats
data frame did not result in the warning message (see attached image) noted in the episode becausecats$coat
is not a factor (it is chr instead).I could not find in previous episodes where this was changed to a factor instead of character data. It may be confusing for learners to not get the warning message that they expect. This also means that the
NA
value does not show up incats
after addingnewRow
to the data frame.