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

Exploring Data Frames episode: add a tip on the usage and the meaning of %in% operator #561

Open
monahton opened this issue Sep 26, 2019 · 1 comment

Comments

@monahton
Copy link

commented Sep 26, 2019

This submission is related to the "Exploring Data Frames" episode http://swcarpentry.github.io/r-novice-gapminder/05-data-structures-part2/index.html.

In the "Removing columns" section, the following commands were used:
drop <- names(cats) %in% c("age")
cats[,!drop]

However, this is the first time the "%in%" operator is used without any clarifications about its usage and what does it do or its meaning. This might create a confusion for students during the execution of this command.

I think it would be better to add a tip here about the meaning of this operator or guide the students on searching for help for this operator.
(I would like to also note here that in the following episode "Subsetting data", there is actually a tip about this operator at the beginning of the lesson but I think it is misplaced as this operator was not actually used in the section in which this tip is placed but later explained in details).
So I think it could be also possible to replace this tip from the "Subsetting Data" episode to "Exploring Data Frames" episode.

@jcoliver

This comment has been minimized.

Copy link
Contributor

commented Sep 26, 2019

Good point, @monahton . Copying the tip from the Subsetting Data episode would be good (probably best to leave the tip in it's original location, too, since the %in% operator could use some reinforcement).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.