-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c65eee2
commit 8708ae6
Showing
31 changed files
with
4,385 additions
and
107 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
_freeze/course-materials/lectures/2_mdsr_viz_1_taxonomy/execute-results/html.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file added
BIN
+103 KB
course-materials/lectures/1first-day-survey/figures/mtcars-pie-chart-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.6 KB
course-materials/lectures/1first-day-survey/figures/mtcars-stacked-bar-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
3 changes: 2 additions & 1 deletion
3
...aterials/lectures/mdsr_viz_1_taxonomy.qmd → ...erials/lectures/2_mdsr_viz_1_taxonomy.qmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+83.4 KB
(240%)
docs/course-materials/first-day-survey/figures/mtcars-pie-chart-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+35.2 KB
(200%)
docs/course-materials/first-day-survey/figures/mtcars-stacked-bar-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.