Day 1: Functions in R (50 min)

Instructions

  • Create a new Rmd file, save it in your document folder with the name "functions-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 12min 56s video Writing Your Own Functions in R.
    • Write a subtitle header for this section.
    • Write and run the code that was explained on the video.
  2. Watch the 8min 46s video How Functions Execute.
    • Write a subtitle header for this section.
    • Write and run the code that was explained on the video.
  3. Watch the 4min 20s video Setting Default Values for Arguments.
    • Write a subtitle header for this section.
    • Write and run the code that was explained on the video.
  4. Watch the 5min 19s video When To Use Named And Unnamed Arguments.
    • Write a subtitle header for this section.
    • Write and run the code that was explained on the video.
  5. Watch the 8min 35s video Combining Functions.
    • Write a subtitle header for this section.
    • Write and run the code that was explained on the video.
  6. Watch the 4min 32s video Calling Functions From Inside Other Functions.
    • Write a subtitle header for this section.
    • Write and run the code that was explained on the video.
  7. Watch the 4min 11s video RStudio Tips and Tricks for Working With Functions.
    • Write a subtitle header for this section.
    • Write and run the code that was explained on the video.


Day 2: Making choices inside R functions (42 min)

Instructions

  • Create a new Rmd file, save it in your document folder with the name "choices-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 11min 51s video Introduction To Conditional Statements.
    • Write a subtitle header for this section.
    • Write and run the code that was explained on the video.
  2. Watch the 7min 17s video Introduction To if Statements In R.
    • Write a subtitle header for this section.
    • Write and run the code that was explained on the video.
  3. Watch the 9min 17s video Introduction To else if And else Statements in R.
    • Write a subtitle header for this section.
    • Write and run the code that was explained on the video.
  4. Watch the 6min 36s video Using if/else if/else Statements Inside of Functions in R.
    • Write a subtitle header for this section.
    • Write and run the code that was explained on the video.
  5. Watch the 6min 10s video Introduction To Nested if Statements in R.
    • Write a subtitle header for this section.
    • Write and run the code that was explained on the video.