Skip to content

Commit

Permalink
day 2 update
Browse files Browse the repository at this point in the history
  • Loading branch information
Nics-Github committed Jan 26, 2024
1 parent c65eee2 commit 8708ae6
Show file tree
Hide file tree
Showing 31 changed files with 4,385 additions and 107 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"hash": "57ee679f0d371dde7a78e1f905e5ae9c",
"result": {
"markdown": "---\ntitle: \"Vizualization Taxonomy\"\nauthor: \"Ben Baumer\"\nformat: \n revealjs:\n theme: beige\n controls: \n true\n\neditor: visual\nexecute:\n freeze: auto # re-render only when source changes\n---\n\n\n\n\n------------------------------------------------------------------------\n\n## [Borrowing heavily from Nathan Yau](https://flowingdata.com/data-points/)\n\n![](https://images-na.ssl-images-amazon.com/images/I/514aUwRUhmL._UX250_.jpg){fig-align=\"center\"}\n\n## Elements of data graphics\n\n- Visual cues\n - position, length, area, etc.\n- Coordinate system\n - how are the data points organized?\n- Scale\n - how does distance translate into meaning?\n- Context\n - in relation to what?\n- Faceting / small multiples\n\n## {background-image=\"https://s-media-cache-ak0.pinimg.com/originals/c2/46/92/c24692fd95dbfb89f772613a316a5405.png\" background-size=\"contain\"}\n\n## {background-image=\"https://i.pinimg.com/736x/90/8f/12/908f129be5844828110233b84056d9f2--data-visualization-points.jpg\" background-size=\"contain\"}\n\n## {background-image=\"https://i.pinimg.com/736x/86/a4/93/86a49342761ca36aeca5f8ee03c64867--data-visualization-points.jpg\" background-size=\"contain\"}\n\n## {background-image=\"https://i.pinimg.com/736x/62/c6/ee/62c6ee636c47dccad00e7e56c268c3bf--data-visualization-points.jpg\" background-size=\"contain\"}\n\n## Big idea\n\nMapping variables to visual cues\n\n![](https://raw.githubusercontent.com/tidyverse/ggplot2/master/man/figures/logo.png){fig-align=\"left\"}\n\n## {background-image=\"https://s-media-cache-ak0.pinimg.com/originals/6d/09/3a/6d093a70e7d772a5e90178b8d609462e.png\" background-size=\"contain\"}\n\n## Do's and don'ts\n\n- **Do**: mind the perceptual heirarchy\n\n - **Don't** use color when length will suffice\n - **Don't** use pie charts!\n\n- **Don't** use redundant mappings unless you have a reason\n\n- **Do** use context!\n\n- **Do** match data dimensions to visual dimensions\n\n - **Don't** map area to a 1D quantity\n\n## Read more about this!\n\n::: {layout-ncol=\"2\"}\n![](https://images-na.ssl-images-amazon.com/images/I/41IXJO4Mk6L.jpg){fig-align=\"left\"}\n\n![](https://images-na.ssl-images-amazon.com/images/I/51lfTMyZ8GL._SX399_BO1,204,203,200_.jpg){fig-align=\"right\"}\n:::\n\n## Tufte's mantra\n\n![](https://image.slidesharecdn.com/presentingviztoclients1-150120165529-conversion-gate02/95/presenting-data-visualizations-to-clients-34-638.jpg?cb=1421773366){fig-align=\"center\"}\n",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": {
"include-after-body": [
"\n<script>\n // htmlwidgets need to know to resize themselves when slides are shown/hidden.\n // Fire the \"slideenter\" event (handled by htmlwidgets.js) when the current\n // slide changes (different for each slide format).\n (function () {\n // dispatch for htmlwidgets\n function fireSlideEnter() {\n const event = window.document.createEvent(\"Event\");\n event.initEvent(\"slideenter\", true, true);\n window.document.dispatchEvent(event);\n }\n\n function fireSlideChanged(previousSlide, currentSlide) {\n fireSlideEnter();\n\n // dispatch for shiny\n if (window.jQuery) {\n if (previousSlide) {\n window.jQuery(previousSlide).trigger(\"hidden\");\n }\n if (currentSlide) {\n window.jQuery(currentSlide).trigger(\"shown\");\n }\n }\n }\n\n // hookup for slidy\n if (window.w3c_slidy) {\n window.w3c_slidy.add_observer(function (slide_num) {\n // slide_num starts at position 1\n fireSlideChanged(null, w3c_slidy.slides[slide_num - 1]);\n });\n }\n\n })();\n</script>\n\n"
]
},
"engineDependencies": {},
"preserve": {},
"postProcess": true
}
}
2 changes: 1 addition & 1 deletion _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ website:
- icon: slack
href: https://www.slack.com
- text: R
href: rstudio.smith.edu
href: https://rstudio.smith.edu/auth-sign-in?appUri=%2F
- text: m
href: https://moodle.smith.edu/

Expand Down
Binary file not shown.
Binary file not shown.
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.
88 changes: 88 additions & 0 deletions course-materials/lectures/2How-R-builds-a-graph.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
title: "How R builds a graph"
author: "Schwab"
format:
revealjs:
theme: beige
editor: visual
---

```{r}
#| message: false
library(tidyverse)
#heights from sds 192.02.02 and 220
heights <- c(60,63,65,69,65,66,59,62,67,69,66,67,64,62,67,67,62,64,66,62,68,63,65,60,66,63,67,64.17,67.75,70,62.64,61,64.5,68,66,64,68,62,66,60,63,64,63,62.5,64,68,68,64,65,66,71,60.6,63,69,66,65,61,61,62,64,65.5,61,62,65,62,66,65,64,63,67,67,63,64.56)
heights <- as.data.frame(heights)
```

## Heights

```{r heights}
ggplot( data=heights , aes(x=heights) ) +
geom_histogram() +
xlab("Heights (inches)") +
ylab("Number of students") +
labs(title = "Heights" ,
subtitle= "Schwab",
caption = "The heights of Fall 2023 SDS 192.03 students as collected via google form",
)
```

## Code

```{r echo=TRUE}
ggplot( data=heights , aes(x=heights) ) +
geom_histogram() +
xlab("Heights (inches)") +
ylab("Number of students") +
labs(title = "Heights" ,
subtitle= "Schwab",
caption = "The heights of Fall 2023 SDS 192.03 students as collected via google form",
)
```

## Be a computer

1. Write the code to make a *bar graph* (why?)

- Consider the Class Year variable.

- Write on paper the code that would make a bar graph of class years in R.

2. Switch with a partner

- Translate the code into a graph (it doesn't have to be exact).

3. Discuss the code.

## Class Year Data to Copy

This is the class year data from our survey.

```{r}
#| echo: TRUE
class_year <- c(2026,2026,2027,2026,2027,2027,2026,2027,2027,2026,2027,2027,2026,2026,2026,2027,2027,2026,2025,2027,2026)
```

## [Open RStudio on the server at Smith.](https://rstudio.smith.edu/auth-sign-in?appUri=%2F)

(If you have it installed you can use your personal copy.)

Your username is your email and your password is your email password.

- In the console type install.packages("tidyverse")

- File -\> New File -\> RScript

- Write your code into the script.

- Highlight code and run it.

- Try to fix errors if you have any.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
title: "Vizualization_Taxonomy"
title: "Vizualization Taxonomy"
author: "Ben Baumer"
format:
revealjs:
theme: beige
controls:
true

Expand Down
45 changes: 0 additions & 45 deletions course-materials/lectures/How-R-builds-a-graph.qmd

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link href="../../site_libs/quarto-html/light-border.css" rel="stylesheet">
<link href="../../site_libs/quarto-html/quarto-html.min.css" rel="stylesheet" data-mode="light">
<link href="../../site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles"><meta charset="utf-8">
<meta name="generator" content="quarto-1.3.450">
<meta name="generator" content="quarto-1.3.353">

<meta name="author" content="Schwab">
<title>SDS 192 Fall ’23 - No Computers Data Viz</title>
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.
2 changes: 1 addition & 1 deletion docs/course-materials/labs/lab6/across.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<span class="menu-text"></span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="../../../rstudio.smith.edu" rel="" target="">
<a class="nav-link" href="https://rstudio.smith.edu/auth-sign-in?appUri=%2F" rel="" target="">
<span class="menu-text">R</span></a>
</li>
<li class="nav-item">
Expand Down
Loading

0 comments on commit 8708ae6

Please sign in to comment.