datacarpentry / R-ecology-lesson

Data Analysis and Visualization in R for Ecologists
https://datacarpentry.org/R-ecology-lesson/
Other
314 stars 508 forks source link

Suggestion: Alter barplot factor challenge in Starting with data to request the "undetermined" level be plotted first. #669

Closed jwsorens closed 4 years ago

jwsorens commented 4 years ago

While reading through the Staring with data lesson, I noticed one of the challenges states "Now that we have renamed the factor level to "undetermined", can you recreate the barplot such that "undetermined" is last (after "male")?". However, due to the way the data is arranged, the previous plot in the lesson already has "undetermined" after both "male" and "female". I would suggest rewording the challenge to say "Now that we have renamed the factor level to "undetermined", can you recreate the barplot such that "undetermined" is first (before "female")?". The answer would need to be changed to...

sex <- factor(sex, levels = c("undetermined", "female", "male"))

This would give learners the opportunity to see how changing the order of levels of a factor influences the order in which the data is plotted. I believe this was originally intended, but not quite shown, with the existing challenge.

Teebusch commented 4 years ago

Thank you @jwsorens, well spotted! I think we overlooked this when replacing read.csv() with read_csv() recently.