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

Suggestions for episode 3 #516

Open
MadeleineGastonguay opened this issue Apr 22, 2021 · 1 comment
Open

Suggestions for episode 3 #516

MadeleineGastonguay opened this issue Apr 22, 2021 · 1 comment

Comments

@MadeleineGastonguay
Copy link

In Analyzing Multiple Data Sets, several downsides of writing individual print statements are listed:

  1. It doesn’t scale: if we want to print the elements in a vector that’s hundreds long, we’d be better off just typing them in.
  2. It’s fragile: if we give it a longer vector, it only prints part of the data, and if we give it a shorter input, it returns NA values because we’re asking for elements that don’t exist!

As I was preparing for the live demo, I kept making typos when writing each print statement, which I think would be a great addition to the list of reasons to use a for loop. Making typos is a very relatable downside, and I think it would help drive home why for loops are useful.

In addition, the lesson mentions the length() function after showing that "a loop variable is just a variable that’s being used to record progress in a loop". When I was working through the lesson, this seemed out of order, because at that point we have moved on from the example where a for loop is used to repeatedly update the value of a variable. Moving the discussion of the length() function to immediately follow the vowels example will create a more organized lesson, and appease more experienced R users who may be thinking "why not just use length()?" a that moment.

@HaoZeke
Copy link
Member

HaoZeke commented Apr 27, 2021

Hi @MadeleineGastonguay, thanks so much for taking time to bring this up! I think your suggestions are fantastic. Would you be willing to make a PR with the changes so we can discuss this further?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants