diff --git a/01_intro_to_r/intro_to_r.html b/01_intro_to_r/intro_to_r.html index 893691e..075b856 100644 --- a/01_intro_to_r/intro_to_r.html +++ b/01_intro_to_r/intro_to_r.html @@ -1683,8 +1683,10 @@

R Packages

Creating a reproducible lab report

We will be using R Markdown to create reproducible lab reports. See the following videos describing why and how:

-

Why use R Markdown for Lab Reports?

-

Using R Markdown for Lab Reports in RStudio

+

Why use R Markdown for Lab Reports?

+

+

Using R Markdown for Lab Reports in RStudio

+

In a nutshell, in RStudio, go to New File -> R Markdown… Then, choose “From Template” and then choose Lab Report for OpenIntro Statistics Lab 1 from the list of templates.

Going forward you should refrain from typing your code directly in the console, as this makes it very difficult to remember and reproduce the output you want to reference. Potentially the most important feature of R Markdown files is that they allow for us to nest our R code within a written report. In an R Markdown file, R code appears in a gray box, which we call “code chunks.” The R Markdown file knows that the gray box contains R code because it begins with three tick marks (```), followed by two curly braces that contain a lowercase letter r ({r}). You’ve already seen this above!

Instead of typing our R code into the console, we encourage you to type any code you produce (final correct answer, or anything you’re just trying out) in the R code chunk associated with each problem. You can execute the R code you type in these code chunks similar to how you typed code into the console and pressed enter/return. Within the code chunk there are two ways to execute a line of R code: (1) place your cursor on the line on code and press Ctrl-Enter or Cmd-Enter at the same time, or (2) place your cursor on the line and press the “Run” button in the upper right hand corner of the R Markdown file. Alternatively, if you wanted to run all of the R code in a given code chunk, you can click on the “Play” button in the upper right hand corner of the code chunk (green sideways triangle).

@@ -1831,7 +1833,7 @@

More Practice

Resources for learning R and working in RStudio

That was a short introduction to R and RStudio, but we will provide you with more functions and a more complete sense of the language as the course progresses.

-

In this course we will be using the suite of R packages from the tidyverse. The book R For Data Science by Grolemund and Wickham is a fantastic resource for data analysis in R with the tidyverse. If you are Goggling for R code, make sure to also include these package names in your search query. For example, instead of Goggling “scatterplot in R”, Goggle “scatterplot in R with the tidyverse”.

+

In this course we will be using the suite of R packages from the tidyverse. The book R For Data Science by Grolemund and Wickham is a fantastic resource for data analysis in R with the tidyverse. If you are Goggling for R code, make sure to also include these package names in your search query. For example, instead of Goggling “scatterplot in R”, Goggle “scatterplot in R with the tidyverse”.

These may come in handy throughout the semester: