Skip to content

Commit

Permalink
update schedule, add first worksheet
Browse files Browse the repository at this point in the history
  • Loading branch information
clauswilke committed Dec 30, 2024
1 parent db2f48f commit 71aa5a9
Show file tree
Hide file tree
Showing 17 changed files with 308 additions and 123 deletions.
4 changes: 4 additions & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ project:
render:
- "*.qmd"
- "!datasets/"
- "!assignments/"
resources:
- "assets/"
- "datasets/"
- "assignments/"

website:
title: "SDS 366"
Expand Down Expand Up @@ -34,6 +36,8 @@ website:

- text: "Worksheets"
menu:
- text: "Class 1: Intro to Quarto"
href: assignments/intro_to_Quarto.qmd
- text: "Class 2: Aesthetic mappings"
href: worksheets/aesthetic-mappings.qmd
- text: "Class 3: Visualizing amounts"
Expand Down
Binary file added _site/assignments/HW1.pdf
Binary file not shown.
36 changes: 36 additions & 0 deletions _site/assignments/HW1.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: "Homework 1"
format: typst
editor: visual
---

```{r}
#| echo: false
#| message: false
# !! Do not edit this code chunk !!
library(tidyverse)
```

**This homework is due on Jan. 23, 2024 at 11:00pm. Please submit as a pdf file on Canvas.**

**Problem 1: (8 pts)** Demonstrate basic command of Quarto document editing by creating a bulleted list with three items, a numbered list with three items, and a sentence that has one word in bold and one word in italics.

*Your text goes here.*

**Problem 2: (6 pts)** The `economics` dataset contains various time series data from the US economy:

```{r}
economics
```

Use ggplot to make a line plot of the total population (`pop`, in thousands) versus time (column `date`).

```{r}
# your code goes here
```

**Problem 3: (6 pts)** Again using the `economics` dataset, now make a scatter plot (using `geom_point()`) of the number of unemployed versus the total population (`pop`), and color points by date.

```{r}
# your code goes here
```
Binary file added _site/assignments/intro_to_Quarto.pdf
Binary file not shown.
41 changes: 41 additions & 0 deletions _site/assignments/intro_to_Quarto.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: "Intro to Quarto"
format:
typst:
fig-width: 4
fig-height: 2.5
editor: visual
---

All assignments in this class will be done via [Quarto documents.](https://quarto.org) Quarto documents are documents that combine text, code, and output, including figures. They are a great way to produce self-contained and documented statistical analyses. Quarto has support for a variety of popular programming languages for data analysis, including R and python.

In this first worksheet, you will learn how to do some basic Quarto editing. After you have made a change to the document, press "Render" in R Studio and see what kind of a result you get. All assignments will be submitted as pdf files and therefore this Quarto document renders into a pdf as well.

Edit only below this line.

------------------------------------------------------------------------

## 1. Basic Markdown editing

Try out basic editing features, as described here: <https://quarto.org/docs/visual-editor/#overview>. Write some text that is bold, and some that is in italics. Make a numbered list and a bulleted list. Make a nested list. Try the block-quote feature.

Also try both the visual and the source editing mode and see which one you prefer.

*Your text goes here.*

## 2. Embedding R code

R code embedded in R chunks will be executed and the output will be shown.

```{r}
library(ggplot2)
ggplot(mtcars, aes(disp, mpg)) +
geom_point()
```

Now you try it. If you know some ggplot, modify the above plot. For example, plot some other data columns (e.g., `hp`, `qsec`, `gear`), or add some color to the plot. If you don't know ggplot but know some other R, try that. If you don't know any R try basic mathematical expressions, such as `45 + 10` or `sqrt(15)`.

```{r}
# Your R code goes here
```
4 changes: 4 additions & 0 deletions _site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-worksheets">
<li>
<a class="dropdown-item" href="./assignments/intro_to_Quarto.qmd">
<span class="dropdown-text">Class 1: Intro to Quarto</span></a>
</li>
<li>
<a class="dropdown-item" href="./worksheets/aesthetic-mappings.html">
<span class="dropdown-text">Class 2: Aesthetic mappings</span></a>
</li>
Expand Down
4 changes: 4 additions & 0 deletions _site/schedule.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-worksheets">
<li>
<a class="dropdown-item" href="./assignments/intro_to_Quarto.qmd">
<span class="dropdown-text">Class 1: Intro to Quarto</span></a>
</li>
<li>
<a class="dropdown-item" href="./worksheets/aesthetic-mappings.html">
<span class="dropdown-text">Class 2: Aesthetic mappings</span></a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion _site/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@
"href": "syllabus.html#topics-covered",
"title": "Syllabus",
"section": "Topics covered",
"text": "Topics covered\n\n\n\n\n\n\n\n\nClass\nTopic\nCoding concepts covered\n\n\n\n\n1.\nIntroduction, reproducible workflows\nRStudio setup online, Quarto\n\n\n2.\nAesthetic mappings\nggplot2 quickstart\n\n\n3.\nTelling a story\n\n\n\n4.\nVisualizing amounts\ngeom_col(), geom_point(), position adjustments\n\n\n5.\nCoordinate systems and axes\ncoords and position scales\n\n\n6.\nVisualizing distributions 1\nstats, geom_density(), geom_histogram()\n\n\n7.\nVisualizing distributions 2\nviolin plots, sina plots, ridgeline plots\n\n\n8.\nColor scales\ncolor and fill scales\n\n\n9.\nData wrangling 1\nmutate(), filter(), arrange()\n\n\n10.\nData wrangling 2\ngroup_by(), summarize(), count()\n\n\n11.\nVisualizing proportions\nbar charts, pie charts\n\n\n12.\nGetting to know your data\nhandling missing data, is.na(), case_when()\n\n\n13.\nGetting things into the right order\nfct_reorder(), fct_lump()\n\n\n14.\nFigure design\nggplot themes\n\n\n15.\nColor spaces, color vision deficiency\ncolorspace package\n\n\n16.\nFunctions and functional programming\nmap(), nest(), purrr package\n\n\n17.\nVisualizing trends\ngeom_smooth()\n\n\n18.\nWorking with models\nlm, cor.test, broom package\n\n\n19.\nVisualizing uncertainty\nfrequency framing, error bars, ggdist package\n\n\n20.\nDimension reduction 1\nPCA\n\n\n21.\nDimension reduction 2\nkernel PCA, t-SNE, UMAP\n\n\n22.\nClustering 1\nk-means clustering\n\n\n23.\nClustering 2\nhierarchical clustering\n\n\n24.\nVisualizing geospatial data\ngeom_sf(), coord_sf()\n\n\n25.\nRedundant coding, text annotations\nggrepel package\n\n\n26.\nInteractive plots\nggiraph package\n\n\n27.\nOver-plotting\njittering, 2d histograms, contour plots\n\n\n28.\nCompound figures\npatchwork package"
"text": "Topics covered\n\n\n\n\n\n\n\n\nClass\nTopic\nCoding concepts covered\n\n\n\n\n1.\nIntroduction, reproducible workflows\nRStudio setup online, Quarto\n\n\n2.\nAesthetic mappings\nggplot2 quickstart\n\n\n3.\nVisualizing amounts, telling a story\ngeom_col(), geom_point(), position adjustments\n\n\n4.\nCoordinate systems and axes\ncoords and position scales\n\n\n5.\nVisualizing distributions 1\nstats, geom_density(), geom_histogram()\n\n\n6.\nVisualizing distributions 2\nviolin plots, sina plots, ridgeline plots\n\n\n7.\nColor scales\ncolor and fill scales\n\n\n8.\nColor spaces, color vision deficiency\ncolorspace package\n\n\n9.\nData wrangling\nmutate(), filter(), arrange() summarize(), join(), pivot_longer()\n\n\n10.\nVisualizing proportions\nbar charts, pie charts\n\n\n11.\nGetting to know your data\nhandling missing data, is.na(), case_when()\n\n\n12.\nGetting things into the right order\nfct_reorder(), fct_lump()\n\n\n13.\nFigure design\nggplot themes\n\n\n14.\nCompound figures\npatchwork package\n\n\n15.\nVisualizing trends\ngeom_smooth()\n\n\n16.\nFunctions and functional programming\nmap(), nest(), purrr package\n\n\n17.\nWorking with models\nlm, cor.test, broom package\n\n\n18.\nVisualizing uncertainty\nfrequency framing, error bars, ggdist package\n\n\n19.\nDimension reduction 1\nPCA\n\n\n20.\nDimension reduction 2\nkernel PCA, t-SNE, UMAP\n\n\n21.\nClustering 1\nk-means clustering\n\n\n22.\nClustering 2\nhierarchical clustering\n\n\n23.\nVisualizing geospatial data\ngeom_sf(), coord_sf()\n\n\n24.\nRedundant coding, text annotations\nggrepel package\n\n\n25.\nOver-plotting\njittering, 2d histograms, contour plots\n\n\n26.\nInteractive plots\nggiraph package\n\n\n27.\nWeb technologies and web design\nCSS\n\n\n28.\nInteractive plots\ngganimate package"
},
{
"objectID": "syllabus.html#computing-requirements",
Expand Down
100 changes: 52 additions & 48 deletions _site/syllabus.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-worksheets">
<li>
<a class="dropdown-item" href="./assignments/intro_to_Quarto.qmd">
<span class="dropdown-text">Class 1: Intro to Quarto</span></a>
</li>
<li>
<a class="dropdown-item" href="./worksheets/aesthetic-mappings.html">
<span class="dropdown-text">Class 2: Aesthetic mappings</span></a>
</li>
Expand Down Expand Up @@ -260,68 +264,68 @@ <h2 class="anchored" data-anchor-id="topics-covered">Topics covered</h2>
</tr>
<tr class="odd">
<td style="text-align: right;">3.</td>
<td style="text-align: left;">Telling a story</td>
<td style="text-align: left;"></td>
<td style="text-align: left;">Visualizing amounts, telling a story</td>
<td style="text-align: left;"><code>geom_col()</code>, <code>geom_point()</code>, position adjustments</td>
</tr>
<tr class="even">
<td style="text-align: right;">4.</td>
<td style="text-align: left;">Visualizing amounts</td>
<td style="text-align: left;"><code>geom_col()</code>, <code>geom_point()</code>, position adjustments</td>
<td style="text-align: left;">Coordinate systems and axes</td>
<td style="text-align: left;">coords and position scales</td>
</tr>
<tr class="odd">
<td style="text-align: right;">5.</td>
<td style="text-align: left;">Coordinate systems and axes</td>
<td style="text-align: left;">coords and position scales</td>
<td style="text-align: left;">Visualizing distributions 1</td>
<td style="text-align: left;">stats, <code>geom_density()</code>, <code>geom_histogram()</code></td>
</tr>
<tr class="even">
<td style="text-align: right;">6.</td>
<td style="text-align: left;">Visualizing distributions 1</td>
<td style="text-align: left;">stats, <code>geom_density()</code>, <code>geom_histogram()</code></td>
<td style="text-align: left;">Visualizing distributions 2</td>
<td style="text-align: left;">violin plots, sina plots, ridgeline plots</td>
</tr>
<tr class="odd">
<td style="text-align: right;">7.</td>
<td style="text-align: left;">Visualizing distributions 2</td>
<td style="text-align: left;">violin plots, sina plots, ridgeline plots</td>
<td style="text-align: left;">Color scales</td>
<td style="text-align: left;">color and fill scales</td>
</tr>
<tr class="even">
<td style="text-align: right;">8.</td>
<td style="text-align: left;">Color scales</td>
<td style="text-align: left;">color and fill scales</td>
<td style="text-align: left;">Color spaces, color vision deficiency</td>
<td style="text-align: left;"><strong>colorspace</strong> package</td>
</tr>
<tr class="odd">
<td style="text-align: right;">9.</td>
<td style="text-align: left;">Data wrangling 1</td>
<td style="text-align: left;"><code>mutate()</code>, <code>filter()</code>, <code>arrange()</code></td>
<td style="text-align: left;">Data wrangling</td>
<td style="text-align: left;"><code>mutate()</code>, <code>filter()</code>, <code>arrange()</code> <code>summarize()</code>, <code>join()</code>, <code>pivot_longer()</code></td>
</tr>
<tr class="even">
<td style="text-align: right;">10.</td>
<td style="text-align: left;">Data wrangling 2</td>
<td style="text-align: left;"><code>group_by()</code>, <code>summarize()</code>, <code>count()</code></td>
<td style="text-align: left;">Visualizing proportions</td>
<td style="text-align: left;">bar charts, pie charts</td>
</tr>
<tr class="odd">
<td style="text-align: right;">11.</td>
<td style="text-align: left;">Visualizing proportions</td>
<td style="text-align: left;">bar charts, pie charts</td>
<td style="text-align: left;">Getting to know your data</td>
<td style="text-align: left;">handling missing data, <code>is.na()</code>, <code>case_when()</code></td>
</tr>
<tr class="even">
<td style="text-align: right;">12.</td>
<td style="text-align: left;">Getting to know your data</td>
<td style="text-align: left;">handling missing data, <code>is.na()</code>, <code>case_when()</code></td>
<td style="text-align: left;">Getting things into the right order</td>
<td style="text-align: left;"><code>fct_reorder()</code>, <code>fct_lump()</code></td>
</tr>
<tr class="odd">
<td style="text-align: right;">13.</td>
<td style="text-align: left;">Getting things into the right order</td>
<td style="text-align: left;"><code>fct_reorder()</code>, <code>fct_lump()</code></td>
<td style="text-align: left;">Figure design</td>
<td style="text-align: left;">ggplot themes</td>
</tr>
<tr class="even">
<td style="text-align: right;">14.</td>
<td style="text-align: left;">Figure design</td>
<td style="text-align: left;">ggplot themes</td>
<td style="text-align: left;">Compound figures</td>
<td style="text-align: left;"><strong>patchwork</strong> package</td>
</tr>
<tr class="odd">
<td style="text-align: right;">15.</td>
<td style="text-align: left;">Color spaces, color vision deficiency</td>
<td style="text-align: left;"><strong>colorspace</strong> package</td>
<td style="text-align: left;">Visualizing trends</td>
<td style="text-align: left;"><code>geom_smooth()</code></td>
</tr>
<tr class="even">
<td style="text-align: right;">16.</td>
Expand All @@ -330,48 +334,48 @@ <h2 class="anchored" data-anchor-id="topics-covered">Topics covered</h2>
</tr>
<tr class="odd">
<td style="text-align: right;">17.</td>
<td style="text-align: left;">Visualizing trends</td>
<td style="text-align: left;"><code>geom_smooth()</code></td>
<td style="text-align: left;">Working with models</td>
<td style="text-align: left;"><code>lm</code>, <code>cor.test</code>, <strong>broom</strong> package</td>
</tr>
<tr class="even">
<td style="text-align: right;">18.</td>
<td style="text-align: left;">Working with models</td>
<td style="text-align: left;"><code>lm</code>, <code>cor.test</code>, <strong>broom</strong> package</td>
<td style="text-align: left;">Visualizing uncertainty</td>
<td style="text-align: left;">frequency framing, error bars, <strong>ggdist</strong> package</td>
</tr>
<tr class="odd">
<td style="text-align: right;">19.</td>
<td style="text-align: left;">Visualizing uncertainty</td>
<td style="text-align: left;">frequency framing, error bars, <strong>ggdist</strong> package</td>
<td style="text-align: left;">Dimension reduction 1</td>
<td style="text-align: left;">PCA</td>
</tr>
<tr class="even">
<td style="text-align: right;">20.</td>
<td style="text-align: left;">Dimension reduction 1</td>
<td style="text-align: left;">PCA</td>
<td style="text-align: left;">Dimension reduction 2</td>
<td style="text-align: left;">kernel PCA, t-SNE, UMAP</td>
</tr>
<tr class="odd">
<td style="text-align: right;">21.</td>
<td style="text-align: left;">Dimension reduction 2</td>
<td style="text-align: left;">kernel PCA, t-SNE, UMAP</td>
<td style="text-align: left;">Clustering 1</td>
<td style="text-align: left;">k-means clustering</td>
</tr>
<tr class="even">
<td style="text-align: right;">22.</td>
<td style="text-align: left;">Clustering 1</td>
<td style="text-align: left;">k-means clustering</td>
<td style="text-align: left;">Clustering 2</td>
<td style="text-align: left;">hierarchical clustering</td>
</tr>
<tr class="odd">
<td style="text-align: right;">23.</td>
<td style="text-align: left;">Clustering 2</td>
<td style="text-align: left;">hierarchical clustering</td>
<td style="text-align: left;">Visualizing geospatial data</td>
<td style="text-align: left;"><code>geom_sf()</code>, <code>coord_sf()</code></td>
</tr>
<tr class="even">
<td style="text-align: right;">24.</td>
<td style="text-align: left;">Visualizing geospatial data</td>
<td style="text-align: left;"><code>geom_sf()</code>, <code>coord_sf()</code></td>
<td style="text-align: left;">Redundant coding, text annotations</td>
<td style="text-align: left;"><strong>ggrepel</strong> package</td>
</tr>
<tr class="odd">
<td style="text-align: right;">25.</td>
<td style="text-align: left;">Redundant coding, text annotations</td>
<td style="text-align: left;"><strong>ggrepel</strong> package</td>
<td style="text-align: left;">Over-plotting</td>
<td style="text-align: left;">jittering, 2d histograms, contour plots</td>
</tr>
<tr class="even">
<td style="text-align: right;">26.</td>
Expand All @@ -380,13 +384,13 @@ <h2 class="anchored" data-anchor-id="topics-covered">Topics covered</h2>
</tr>
<tr class="odd">
<td style="text-align: right;">27.</td>
<td style="text-align: left;">Over-plotting</td>
<td style="text-align: left;">jittering, 2d histograms, contour plots</td>
<td style="text-align: left;">Web technologies and web design</td>
<td style="text-align: left;">CSS</td>
</tr>
<tr class="even">
<td style="text-align: right;">28.</td>
<td style="text-align: left;">Compound figures</td>
<td style="text-align: left;"><strong>patchwork</strong> package</td>
<td style="text-align: left;">Interactive plots</td>
<td style="text-align: left;"><strong>gganimate</strong> package</td>
</tr>
</tbody>
</table>
Expand Down
Loading

0 comments on commit 71aa5a9

Please sign in to comment.