R-ecology-lesson icon indicating copy to clipboard operation
R-ecology-lesson copied to clipboard

section on factors may be confusing

Open Talishask opened this issue 3 years ago • 1 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.

Having assisted as a helper in several training sessions I have noted that attendees can struggle with the concept of factors. When discussing factors I think it would be beneficial to use a column that has more than 2 levels within the dataset already used in the previous section. For example taxa within the surveys dataset (has 4 levels). By creating a new variable name of sex (as it is in the current lesson plan) it complicates issues of how it relates to the data set used in the previous section of indexing and subsetting data frames

(i.e nlevels(surveys$taxa) )

Within the same lesson plan would it be possible to make reference to using tab complete (a little like autocomplete, or predicative text on a phone) to assist with populating code for the function being used or for the directory of the file if importing a dataset

https://datacarpentry.org/R-ecology-lesson/02-starting-with-data.html

thanks in advance

Talishask avatar Jul 29 '20 16:07 Talishask

These are two separate issues:

Issue 1: creating a toy example of a factor with two levels is confusing I don't think I fully agree, and I think the issue may have been addressed by the recent changes (#663):

  • The lesson first introduces the idea that sex should be a factor column and demonstrates the effect of converting the column to a factor.
  • then a toy factor vector is created that mimics the sex column and it is used to demonstrate the properties of factors in R and some useful functions for working with factors (e.g. nlevels). (Maybe it could be made more clear that this is what's happening?)
  • then the challenge asks learners to apply what they have learned to (1) convert other columns of the data frame to factors, and (2) explore the numbers of factor levels etc. using the functions.
  • finally, there's a section on converting factors to characters and renaming factor levels that deepens the understanding of how factors work.

I prefer to have the tiny toy factor vector to explain the basics, rather than the unwieldy real data. Do others disagree?

Issue 2: Mentioning tab-completion for object, function and file names. ~~This issue is related to #646. I would suggest to decide whether the first issue can be closed and track the implementation of the second issue in #646~~ This issue has been fixed by #646

Teebusch avatar Oct 20 '20 10:10 Teebusch