From 7e129ef52a67e79addbd744bb6a38ef0fcc897d0 Mon Sep 17 00:00:00 2001 From: carriewright11 Date: Sun, 29 Sep 2024 21:20:43 -0400 Subject: [PATCH] making directions more clear --- modules/RStudio/lab/RStudio_Lab.Rmd | 7 +------ modules/RStudio/lab/RStudio_Lab_Key.Rmd | 28 ++++++------------------- 2 files changed, 7 insertions(+), 28 deletions(-) diff --git a/modules/RStudio/lab/RStudio_Lab.Rmd b/modules/RStudio/lab/RStudio_Lab.Rmd index 295dce2f..9604d9f3 100644 --- a/modules/RStudio/lab/RStudio_Lab.Rmd +++ b/modules/RStudio/lab/RStudio_Lab.Rmd @@ -45,9 +45,7 @@ ggplot(aes(x = year, y = rate, colour = county, group = county), data = er_3) + scale_colour_manual(values = palette) ``` -```{r out.width = "100%", label = '0response'} -``` # Exercise @@ -70,10 +68,7 @@ x <- c(1, 2, 3) # Practice on Your Own! -### P.1 - -Update the options of the R chunk you just made (with the lowercase x in it) so that the output option is `show output only`. How does the chunk look now? -### P.2 +### P.1 Create another R Markdown Document from RStudio dropdowns: File → New File → R Markdown. diff --git a/modules/RStudio/lab/RStudio_Lab_Key.Rmd b/modules/RStudio/lab/RStudio_Lab_Key.Rmd index 90b3cb6a..9bf12305 100644 --- a/modules/RStudio/lab/RStudio_Lab_Key.Rmd +++ b/modules/RStudio/lab/RStudio_Lab_Key.Rmd @@ -28,24 +28,8 @@ When you click the **Knit** button (at the top of RStudio), a document will be g Here is code that will make a plot of some data.You can embed an R code chunk like this: Try pressing the green play button to see what happens. Make sure you have run the previous code chunk first by pressing the green play button in that chunk. -```{r plot, out.width = "100%"} -# keep only some counties -er_3 <- er_2 %>% - filter(county %in% c("Arapahoe", "Denver", "Jefferson", "Larimer")) - -palette <- c( - Arapahoe = "blue", - Denver = "darkgreen", - Jefferson = "orange", - Larimer = "purple" -) - -ggplot(aes(x = year, y = rate, colour = county, group = county), data = er_3) + - geom_line() + - scale_colour_manual(values = palette) -``` -```{r out.width = "100%", label = '0response'} +```{r out.width = "100%"} # keep only some counties er_3 <- er_2 %>% filter(county %in% c("Arapahoe", "Denver", "Jefferson", "Larimer")) @@ -73,7 +57,7 @@ Go through the code for the plot above and change the colors in `palette` to som ### 1.2 -Add a new R chunk after ``. You can use the insert chunk button or copy paste an existing code chunk. Include a lowercase x inside the chunk as the code. Make sure you press the knit button after this to see what the new chunk looks like. +Add a new R chunk after ``. You can use the insert chunk button or copy paste an existing code chunk. Include a lowercase x inside the chunk as the code. Make sure you press the knit button after this to see what the new chunk looks like. ```{r} x <- c(1, 2, 3) @@ -81,12 +65,12 @@ x <- c(1, 2, 3) +```{r} +x +``` + # Practice on Your Own! ### P.1 -Update the options of the R chunk you just made (with the lowercase x in it) so that the output option is `show output only`. How does the chunk look now? - -### P.2 - Create another R Markdown Document from RStudio dropdowns: File → New File → R Markdown.