Skip to content

Commit

Permalink
Merge branch 'main' into repo-sync/OTTR_Template/default
Browse files Browse the repository at this point in the history
  • Loading branch information
laderast committed Sep 20, 2024
2 parents 9b6cdc9 + fc32fd3 commit 0e0b144
Show file tree
Hide file tree
Showing 975 changed files with 15,068 additions and 163,019 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/render-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ on:
branches: [ main, staging ]
paths:
- '**md$'
- '**.Rmd'
- '*.R'
- assets/*
- quizzes/*
- slides/*

jobs:

Expand Down Expand Up @@ -68,7 +71,8 @@ jobs:
run: |
rm -rf docs/*
Rscript -e "bookdown::render_book('index.Rmd', output_format = 'all');
file.copy(from = 'assets', to = 'docs/assets', overwrite = TRUE)"
file.copy(from = 'assets', to = 'docs/assets', overwrite = TRUE);
file.copy(from = 'slides', to = 'docs/slides', overwrite = TRUE);"
- name: Render quarto version
id: quarto
Expand Down
4 changes: 0 additions & 4 deletions 01-intro-to-computing.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ sum(18, 21)
sum(18, sum(21, 65))
```

Remember the function machine from algebra class? We will use this schema to think about expressions.

![Function machine from algebra class. ](https://cs.wellesley.edu/~cs110/lectures/L16/images/function.png)

If an expression is made out of multiple, nested operations, what is the proper way of the R Console interpreting it? Being able to read nested operations and nested functions as a programmer is very important.

```{r}
Expand Down
2 changes: 1 addition & 1 deletion 03-data-wrangling1.Rmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Data Wrangling with Tidy Data, Part 1

```{r, echo=F, message=F, warning=F, error=F}
install.packages("palmerpenguins")
install.packages("palmerpenguins", repos = "http://cran.us.r-project.org")
library(palmerpenguins)
library(tidyverse)
load(url("https://github.com/fhdsl/Intro_to_R/raw/main/classroom_data/CCLE.RData"))
Expand Down
2 changes: 1 addition & 1 deletion 04-data-wrangling2.Rmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Data Wrangling with Tidy Data, Part 2

```{r, echo=F, message=F, warning=F, error=F}
install.packages("palmerpenguins")
install.packages("palmerpenguins", repos = "http://cran.us.r-project.org")
library(palmerpenguins)
library(tidyverse)
load(url("https://github.com/fhdsl/Intro_to_R/raw/main/classroom_data/CCLE.RData"))
Expand Down
16 changes: 12 additions & 4 deletions 05-data-visualization.Rmd
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
# Data Visualization

```{r, echo=F, message=F, warning=F, error=F}
install.packages("palmerpenguins")
install.packages("palmerpenguins", repos = "http://cran.us.r-project.org")
```

```{r, echo=F, message=F, warning=F, error=F}
library(tidyverse)
library(palmerpenguins)
```

In our final to last week together, we learn about how to do visualize our data. There are several different data visualization tools in R, and we focus on one of the most popular, "Grammar of Graphics", or known as "ggplot". The syntax for "ggplot" will look a bit different than the code we have been writing, with syntax such as `ggplot(penguins) + aes(x = bill_length_mm) + geom_histogram()`. The output of all of these functions, such as from `ggplot()` or `aes()` are not data types or data structures that we are familiar with...rather, they are graphical information. You should be worried less about how this syntax is similar to what we have learned in the course so far, but to view it as a new grammar (of graphics!) that you can "layer" on to create more sophisticated plots.
Now that we have learned basic data structures in R, we can now learn about how to do visualize our data. There are several different data visualization tools in R, and we focus on one of the most popular, "Grammar of Graphics", or known as "ggplot".

The syntax for `ggplot` will look a bit different than the code we have been writing, with syntax such as:

```{r}
ggplot(penguins) + aes(x = bill_length_mm) + geom_histogram()
```

The output of all of these functions, such as from `ggplot()` or `aes()` are not data types or data structures that we are familiar with...rather, they are graphical information.

You should be worried less about how this syntax is similar to what we have learned in the course so far, but to view it as a new grammar (of graphics!) that you can "layer" on to create more sophisticated plots.


To get started, we will consider these most simple and common plots:

**Univariate**

- Numeric: histogram

- Character: bar plots

**Bivariate**

- Numeric vs. Numeric: Scatterplot, line plot

- Numeric vs. Character: Box plot

Why do we focus on these common plots? Our eyes are better at distinguishing certain visual features more than others. All of these plots are focused on their position to depict data, which gives us the most effective visual scale.
Expand Down
15 changes: 15 additions & 0 deletions Intro_to_R.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: knitr
LaTeX: pdfLaTeX

BuildType: Website
Binary file added Introduction to R.rds
Binary file not shown.
2 changes: 1 addition & 1 deletion _bookdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ repo: https://github.com/jhudsl/OTTR_Template/
rmd_files: ["index.Rmd",
"01-intro-to-computing.Rmd",
"02-data-structures.Rmd",
"05-data-visualization.Rmd",
"03-data-wrangling1.Rmd",
"04-data-wrangling2.Rmd",
"05-data-visualization.Rmd",
"06-cheatsheet.Rmd",
"About.Rmd",
"References.Rmd"]
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions _extensions/r-wasm/drop/_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
title: Quarto Drop
author: George Stagg
version: 0.1.0-dev
quarto-required: ">=1.3.0"
contributes:
revealjs-plugins:
- name: RevealDrop
script:
- drop-runtime.js
stylesheet:
- drop-runtime.css
config:
drop:
button: true
shortcut: "`"
engine: webr
webr:
packages: []
pyodide:
packages: []
37 changes: 37 additions & 0 deletions _extensions/r-wasm/drop/drop-runtime.css

Large diffs are not rendered by default.

147 changes: 147 additions & 0 deletions _extensions/r-wasm/drop/drop-runtime.js

Large diffs are not rendered by default.

175 changes: 0 additions & 175 deletions docs/01-intro-to-computing-exercises.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs/01-intro-to-computing.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ sum(18, sum(21, 65))
## [1] 104
```

Remember the function machine from algebra class? We will use this schema to think about expressions.

![Function machine from algebra class. ](https://cs.wellesley.edu/~cs110/lectures/L16/images/function.png)

If an expression is made out of multiple, nested operations, what is the proper way of the R Console interpreting it? Being able to read nested operations and nested functions as a programmer is very important.


Expand Down
13 changes: 0 additions & 13 deletions docs/01-intro.md

This file was deleted.

Loading

0 comments on commit 0e0b144

Please sign in to comment.