Skip to content

Commit

Permalink
making directions more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
carriewright11 committed Sep 30, 2024
1 parent 6449205 commit 7e129ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 28 deletions.
7 changes: 1 addition & 6 deletions modules/RStudio/lab/RStudio_Lab.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
28 changes: 6 additions & 22 deletions modules/RStudio/lab/RStudio_Lab_Key.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -73,20 +57,20 @@ Go through the code for the plot above and change the colors in `palette` to som

### 1.2

Add a new R chunk after `<!-- Your code chunk goes here -->`. 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 `<!-- Your code chunk goes here -->`. 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)
```

<!-- Your code chunk goes here -->

```{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.

0 comments on commit 7e129ef

Please sign in to comment.