Loops in R

Watching all videos for this section takes ~ 51 min. Hint: Watch the videos with a higher reproduction speed to save some time.

Instructions

  • Create a new Rmd file, save it in your document folder with the name "loops-prep.Rmd".
  • Write a title for this section (using a first level header, indicated with one hashtag followed by a blank space # )
  • After (or during) watching each video, write the code that is being explained by the virtual instructor in your Rmd file.
    • Write a subtitle before the code section of each video (as a second level header indicated with two hastags followed by a blank space ## ).
    • Write each piece of code explained in the video in its own R chunk.
    • ⚠️ If the code gives an error or does not run, you can tell R not to run it by using the option eval = FALSE inside the R chunk:
      ```{r, eval = FALSE}
      your code that does not run goes here.
      ```
      
  • Knit to pdf.
  • Git add, commit and push both files (Rmd and PDF).
  1. Watch the 9min 44s video Basic For Loops in R.
    • Write a subtitle header for this section.
    • Write and run the code that was explained on the video.
  2. Watch the 15min 43s video Looping By Index.
    • Write a subtitle header for this section.
    • Write and run the code that was explained on the video.
  3. Watch the 5min 48s video Looping Over Multiple Objects.
    • Write a subtitle header for this section.
    • Write and run the code that was explained on the video.
  4. Watch the 9min 21s video Looping Using Functions.
    • Write a subtitle header for this section.
    • Write and run the code that was explained on the video.
  5. Watch the 10min 21s video Looping Over Files.
    • Write a subtitle header for this section.
    • Write and run the code that was explained on the video.