Skip to content

Commit

Permalink
Render site
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 8, 2024
1 parent 29fb82f commit 30cf9e8
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 48 deletions.
6 changes: 1 addition & 5 deletions modules/RStudio/RStudio.html
Original file line number Diff line number Diff line change
Expand Up @@ -3196,11 +3196,7 @@ <h1 data-config-title><!-- populated from slide_config.json --></h1>
</hgroup>
</slide>

<slide class=""><hgroup><h2>Help! Office hours</h2></hgroup><article id="help-office-hours">

<p>Office hours will always be held at the <em>same Zoom link</em>.</p>

</article></slide><slide class=""><hgroup><h2>Working with R – RStudio</h2></hgroup><article id="working-with-r-rstudio">
<slide class=""><hgroup><h2>Working with R – RStudio</h2></hgroup><article id="working-with-r-rstudio">

<p>RStudio is an Integrated Development Environment (IDE) for R</p>

Expand Down
31 changes: 14 additions & 17 deletions modules/RStudio/lab/RStudio_Lab.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,22 @@ You may be asked a question in the console when you do this. If so, answer by ty
### 0.3

Now install a package that the instructors made that is not on CRAN but on GitHub, by copy and pasting the code into the console. We still don't want to copy the backticks.<br>
`install_github("jhudsl/jhur")`<br>
`install_github("fhdsl/dasehr")`<br>
You may be asked a question in the console when you do this. If so, answer by typing Yes into the console.


The gray area below is a code chunk that will set up our packages and data (this will not show up in the rendered report when we press knit). You can also run the code within the editor area by pressing the green play button. Don't worry right now about what the code is doing, we will cover this later. We just want you to get used to RStudio and RMarkdowns.

```{r setup, message=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(jhur)
library(dasehr)
library(ggplot2)
library(dplyr)
long <- read_circulator_long()
## take just average ridership per day
avg <- long %>%
filter(type == "Average")
ER <- CO_heat_ER_bygender
# keep non-missing data
avg <- avg %>%
filter(!is.na(number))
ER_2 <- ER %>%
filter(!is.na(rate))
```

When you click the **Knit** button (at the top of RStudio), a document will be generated that includes both content as well as the output of any embedded R code chunks within the document.
Expand All @@ -67,21 +64,21 @@ Here is code that will make a plot of the average daily ridership in Baltimore C

Here we plot a few days. 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_circ, out.width = "100%"}
```{r plot, out.width = "100%"}
# keep only some days
avg <- avg %>%
filter(day %in% c("Monday", "Tuesday", "Friday", "Saturday"))
ER_3 <- ER_2 %>%
filter(county %in% c("Arapahoe", "Denver", "Jefferson", "Larimer"))
palette <- c(
banner = "blue",
green = "darkgreen",
orange = "orange",
purple = "purple"
Arapahoe = "blue",
Denver = "darkgreen",
Jefferson = "orange",
Larimer = "purple"
)
ggplot(aes(x = date, y = number, colour = line), data = avg) +
ggplot(aes(x = year, y = rate, colour = county, group = county), data = ER_3) +
geom_line() +
facet_wrap(~day) +
facet_wrap(~gender) +
scale_colour_manual(values = palette)
```

Expand Down
49 changes: 23 additions & 26 deletions modules/RStudio/lab/RStudio_Lab_Key.html

Large diffs are not rendered by default.

0 comments on commit 30cf9e8

Please sign in to comment.