diff --git a/_freeze/materials/slides_6b/execute-results/html.json b/_freeze/materials/slides_6b/execute-results/html.json index 7a9cc97..a5fe935 100644 --- a/_freeze/materials/slides_6b/execute-results/html.json +++ b/_freeze/materials/slides_6b/execute-results/html.json @@ -2,7 +2,7 @@ "hash": "c9603b43477ebc39e37847232ca6d6b5", "result": { "engine": "knitr", - "markdown": "---\ntitle: \"Intro to Data Science\"\nauthor: \"Lab 6 -- Visualization II\"\nengine: knitr\nformat: \n revealjs: \n slide-number: c\n scrollable: false\n code-overflow: wrap\n code-line-numbers: false\n code-copy: hover\n theme: [night, slides.scss]\n reference-location: document\n footer: \"[Programming in R for Biologists](https://njlyon0.github.io/teach_r-for-biologists/)\"\n---\n\n::: {.cell}\n::: {.cell-output .cell-output-stdout}\n\n```\n\nThe downloaded binary packages are in\n\t/var/folders/9m/7tv5z0_j2q34mnkv7907vm540000gn/T//RtmpMmBy7y/downloaded_packages\n```\n\n\n:::\n:::\n\n::: {.cell}\n\n:::\n\n\n## A Guide to Your Process\n\n### [Scheduling]{.blue}\n\n### [Learning Objectives]{.purple}\n\n### [Practice]{.pink}\n\n### [Supporting Information]{.orange}\n\n### [Class Discussion]{.gold}\n\n## [Today's Plan]{.blue}\n\n- Muddiest Point Review\n- Data Visualization with `ggplot2`\n - Editing `theme` elements\n- Multi-Panel Graphs\n- GitHub Presence Check-Ins (1-on-1)\n - _Not_ graded! Don't stress!\n\n## [Today's Learning Objectives]{.purple}\n\nAfter today's session you will be able to:\n\n. . .\n\n- Modify background elements in a `ggplot2` graph\n- Create publication-quality figures with `ggplot2`\n- Explain the difference between plot faceting and plot grids\n\n## [Muddiest Point Review]{.gold}\n\n- Recurring topics from most recent MPs:\n\n\\\n\n. . .\n\n- What other topic(s) would you like to review?\n\n## [`ggplot2` Review]{.orange} {.smaller}\n\n- ggplots require: (1) data, (2) aesthetics, (3) geometries\n - Optionally can mess with `theme` parameters\n\n. . .\n\n\n::: {.cell layout-align=\"center\"}\n::: {.cell-output-display}\n![](slides_6b_files/figure-revealjs/ex-graph-v7-1.png){fig-align='center' width=576}\n:::\n:::\n\n\n## [Theme Internal Structure]{.orange} {.smaller}\n\n- Theme is composed of [elements]{.purple}\n\n\\\n\n- Elements can be modified as desired inside of `theme` function\n\n\\\n\n- Each type of element has a different 'helper function' needed to modify that element\n - Change text = use `element_text`\n - Change line = use `element_line`\n - _Remove_ an element with `element_blank`\n\n## [Theme Syntax]{.orange} {.smaller}\n\n- You use the `theme` function _once_ with as many `element_...` functions as you need\n\n\\\n\n- Here's an example of the proper syntax\n```{.r}\n# Make a simple scatterplot\nggplot(data = my_df, mapping = aes(x = x_var, y = y_var)) +\n geom_point() +\n # Modify its theme to make the axis font size bigger\n theme(axis.text = element_text(size = 20),\n # Also remove the grid lines\n panel.grid = element_blank())\n```\n\n\\\n\n. . . \n\n- Note how the `theme` and `element_...` functions are used together\n\n## [Gridline Theme Components]{.orange} {.smaller}\n\n- You'll learn theme element names as you work more with `ggplot2`\n\n\\\n\n. . . \n\n- Here are a few broadly relevant ones:\n - Gridlines = `panel.grid`\n - Plot background = `panel.background`\n - Axis lines (X & Y) = `axis.line`\n\n## [Get Ready]{.pink} {.smaller}\n\n![](images/hex-ggplot2.png){.absolute top=0 left=1100 width=\"12%\"}\n\n1. Create a script for this week\n\n\\\n\n2. Load `ggplot2`\n\n\\\n\n3. Read \"minnow.csv\" into R and check the structure!\n\n\\\n\n4. Copy the _final_ graph we made last time\n\n\\\n\n5. Assign the graph to an object\n\n## [Remove Gridlines]{.pink} {.smaller}\n\n![](images/hex-ggplot2.png){.absolute top=0 left=1100 width=\"12%\"}\n\n- To that graph, add the following code:\n - `theme(panel.grid = element_blank())`\n\n\\\n\n- What does this do to your graph?\n\n\\\n\n- What happens if you add these two lines as well (**inside** of the `theme` parentheses!)?\n - `panel.background = element_blank()`\n - `axis.line = element_line(color = \"black\"))`\n\n## [Remove Gridlines]{.pink} {.smaller}\n\n![](images/hex-ggplot2.png){.absolute top=0 left=1100 width=\"12%\"}\n\n::::{.columns}\n:::{.column width=\"50%\"}\n\n\n::: {.cell}\n::: {.cell-output-display}\n![](slides_6b_files/figure-revealjs/ex-graph-v8a-1.png){width=960}\n:::\n:::\n\n\n:::\n:::{.column width=\"50%\"}\n\n\n::: {.cell}\n::: {.cell-output-display}\n![](slides_6b_files/figure-revealjs/ex-graph-v8b-1.png){width=960}\n:::\n:::\n\n\n:::\n::::\n\n## [Changing Text Size]{.orange} {.smaller}\n\n- We can also modify text size inside of `theme`\n\n\\\n\n. . . \n\n- Axis \"[title]{.purple}\" vs. axis \"[text]{.gold}\"\n - `axis.title` = axis label text (given to `labs` function)\n - `axis.text` = text on axis tick marks\n\n\\\n\n. . . \n\n![](images/graph-title-v-text.png){.absolute top=80 left=750 width=\"40%\"}\n\n. . . \n\n- Want to modify just X or Y? Add that to the element name!\n - E.g., `theme(axis.text.x = element_text(...))`\n\n\\\n\n. . . \n\nIncrease font size with: `element_text(size = 14)`\n\n## [Change Text Size]{.pink} {.smaller}\n\n![](images/hex-ggplot2.png){.absolute top=0 left=1100 width=\"12%\"}\n\n- Take your most recent graph\n - No gridlines, no background gray square, black axis lines\n\n\\\n\n. . .\n\n- And make the following tweaks:\n - Make the axis _title_ font size 15\n - Make the axis _text_ font size 13\n\n\\\n\n. . .\n\n- What does that leave you with?\n\n## [Change Text Size]{.pink} {.smaller}\n\n![](images/hex-ggplot2.png){.absolute top=0 left=1100 width=\"12%\"}\n\n\n::: {.cell layout-align=\"center\"}\n::: {.cell-output-display}\n![](slides_6b_files/figure-revealjs/ex-graph-v9-1.png){fig-align='center' width=576}\n:::\n:::\n\n\n## [Customizing Legend]{.orange} {.smaller}\n\n- You can also customize the plot legend in the `theme` function!\n - Legend placement = `legend.position`\n - Legend title = `legend.title`\n\n\\\n\n. . .\n\n- `legend.position` works differently than most other elements!\n - Instead of wanting `element_...` it wants `c(, )`\n - Positions range from 0 (left / bottom) to 1 (right / top)\n\n## [Customizing Legend Syntax]{.orange} {.smaller}\n\n- Check out an example where we put the legend in the middle of the plot\n```{.r}\n# Example scatterplot\nggplot(data = my_df, mapping = aes(x = x_var, y = y_var)) +\n geom_point() +\n # With legend in the middle of the space\n theme(legend.position = c(0.5, 0.5))\n```\n\n\\\n\n. . .\n\n- That graph would have the legend in both:\n - the center (left / right)\n - the middle (top / bottom)\n\n## [Customize Legend]{.pink} {.smaller}\n\n![](images/hex-ggplot2.png){.absolute top=0 left=1100 width=\"12%\"}\n\n- To the graph you created last practice:\n - Remove the legend title\n - Experiment with legend placement until you’re happy\n\n\\\n\n- You may put the legend wherever you'd like _but_:\n - It should not overlap any points / boxplots\n\n\\\n\n- What does _that_ graph look like?\n\n## [Customize Legend]{.pink} {.smaller}\n\n![](images/hex-ggplot2.png){.absolute top=0 left=1100 width=\"12%\"}\n\n\n::: {.cell layout-align=\"center\"}\n::: {.cell-output-display}\n![](slides_6b_files/figure-revealjs/ex-graph-v10-1.png){fig-align='center' width=576}\n:::\n:::\n\n\n## [Temperature Check]{.purple}\n\n#### How are you Feeling?\n\n

\n\"Comic-style\n

\n\n## [Multi-Panel Background]{.orange} {.smaller}\n\n::::{.columns}\n:::{.column width=\"65%\"}\n- Sometimes nice to have multiple graphs next to each other\n - Makes direct comparison easier\n - Journals have limits on number of figures but multi-panels still count as 1\n\n\\\n\n- Two methods (for ggplots):\n 1. `ggplot2::facet_...`\n 2. `cowplot::plot_grid()`\n\n:::\n:::{.column width=\"35%\"}\n\n\"Three\n\n:::\n::::\n\n## [Facted Graphs]{.orange} {.smaller}\n\n- `ggplot2` has an internal way of handling this called [facets]{.purple}\n\n\\\n\n- Facets work just like geometries\n - You get separate plots for each level of the facet variable\n\n\\\n\n- Facets must _all_ be the same plot type and _have identical axes_\n - Sometimes not an issue but good to keep in mind!\n\n## [Fact Syntax]{.orange} {.smaller}\n\n- To facet into 1 row x many columns:\n```{.r}\n# Example scatterplot\nggplot(data = my_df, mapping = aes(x = x_var, y = y_var)) +\n geom_point() +\n # Facet into rows of some other variable\n facet_grid(. ~ facet_variable)\n```\n\n\\\n\n. . .\n\n- To facet into many rows x 1 column:\n```{.r}\n# Example scatterplot\nggplot(data = my_df, mapping = aes(x = x_var, y = y_var)) +\n geom_point() +\n # Facet into rows of some other variable\n facet_grid(facet_variable ~ .)\n```\n\n## [Facet Example]{.orange} {.smaller}\n\n![](images/hex-penguins.png){.absolute top=0 left=1100 width=\"12%\"}\n![](images/hex-ggplot2.png){.absolute top=0 left=965 width=\"12%\"}\n\n- `facet_grid(. ~ island)`\n\n\n::: {.cell layout-align=\"center\"}\n::: {.cell-output-display}\n![](slides_6b_files/figure-revealjs/ex-facet-1.png){fig-align='center' width=576}\n:::\n:::\n\n\n## [Facet]{.pink} {.smaller}\n\n![](images/hex-ggplot2.png){.absolute top=0 left=1100 width=\"12%\"}\n\n- Using the fish data, make a new graph that:\n - Has nest _diameter_ on the X axis\n - Has nest _depth_ on the Y axis\n - Is a scatterplot\n - Faceted by species\n - Plus any additional `theme` tweaks you want to make!\n\n\\\n\n- What does your plot look like?\n\n## [Facet]{.pink} {.smaller}\n\n![](images/hex-ggplot2.png){.absolute top=0 left=1100 width=\"12%\"}\n\n\n::: {.cell layout-align=\"center\"}\n::: {.cell-output-display}\n![](slides_6b_files/figure-revealjs/ex-graph-v11-1.png){fig-align='center' width=576}\n:::\n:::\n\n\n## [Plot Grids]{.orange} {.smaller}\n\n- Facets work great when all panels are the same\n - What about when you have several types of graph?\n\n\\\n\n. . . \n\n- `cowplot::plot_grid` lets you put multiple different graphs together\n\n\\\n\n. . . \n\n- Have to make graphs _separately_ first, _then_ combine them\n\n\\\n\n. . . \n\n- Example syntax: \n - `cowplot::plot_grid(plot1, plot2, ncol = 1, nrow = 2)`\n - A lot of other optional arguments\n\n## [Plot Grid Example]{.orange} {.smaller}\n\n\n::: {.cell layout-align=\"center\"}\n::: {.cell-output-display}\n![](slides_6b_files/figure-revealjs/ex-multi-panel-1.png){fig-align='center' width=960}\n:::\n:::\n\n\n## [Plot Grids]{.pink} {.smaller}\n\n![](images/hex-cowplot.png){.absolute top=0 left=1100 width=\"12%\"}\n![](images/hex-ggplot2.png){.absolute top=0 left=965 width=\"12%\"}\n\n- Make two graphs using the fish data:\n\n1. Copy your faceted graph of diameter vs. depth\n - But remove the facet by species\n\n2. Make a boxplot with flow on the y-axis and species on the x-axis\n\n\\\n\n- Using `plot_grid`, make a multi-panel graph with these two graphs\n - Make them side by side (I.e., 2 columns, 1 row)\n\n## [Plot Grids]{.pink} {.smaller}\n\n![](images/hex-cowplot.png){.absolute top=0 left=1100 width=\"12%\"}\n![](images/hex-ggplot2.png){.absolute top=0 left=965 width=\"12%\"}\n\n\\\n\\\n\n\n::: {.cell layout-align=\"center\"}\n::: {.cell-output-display}\n![](slides_6b_files/figure-revealjs/ex-graph-v12-1.png){fig-align='center' width=960}\n:::\n:::\n\n\n## [Temperature Check]{.purple}\n\n#### How are you Feeling?\n\n

\n\"Comic-style\n

\n\n## [GitHub Presence FAQ]{.orange} {.smaller}\n\n- Worth 40 pts (16% course grade)\n\n\\\n\n- Checklist-style rubric on Canvas\n\n\\\n\n- Due [day before _last_ lab]{.blue}\n\n\\\n\n- Can basically finish all of it now though if you want!\n\n## [GitHub Presence Assignment]{.orange} {.smaller}\n\n- This assignment will seriously help in interviews / job apps!\n - Shows how good of a data scientist you are\n\n\\\n\n. . .\n\n- I don't want anyone caught unawares by this assignment\n - So I'll meet with each of you 1-on-1 today to see where you're at so far\n\n\\\n\n. . .\n\n- Good chance for you to ask any questions you have!\n - Also lets me give you tips for success\n\n## [Upcoming Due Dates]{.blue} {.smaller}\n\n::::{.columns}\n:::{.column width=\"50%\"}\n\n### Due before lecture\n\n#### (By midnight)\n\n- Homework \\#6\n\n:::\n:::{.column width=\"50%\"}\n\n### Due before lab\n\n#### (By midnight)\n\n- Muddiest Point \\#7\n- Submit [Draft 2]{.pink} of Function Tutorials\n - Double check rubric to see that you're not leaving any points on the table!\n - Remember to also submit the Revision Response\n\n:::\n::::\n\n## [GitHub 1-on-1s]{.gold} {.smaller}\n\n- Stick around until we do our 1-on-1\n\n\\\n\n- After you have met with me you can leave\n - Though you're welcome to stay and work on Homework \\#6 / course assignments!\n\n\\\n\n- Any volunteers to go first?\n", + "markdown": "---\ntitle: \"Intro to Data Science\"\nauthor: \"Lab 6 -- Visualization II\"\nengine: knitr\nformat: \n revealjs: \n slide-number: c\n scrollable: false\n code-overflow: wrap\n code-line-numbers: false\n code-copy: hover\n theme: [night, slides.scss]\n reference-location: document\n footer: \"[Programming in R for Biologists](https://njlyon0.github.io/teach_r-for-biologists/)\"\n---\n\n::: {.cell}\n\n:::\n\n::: {.cell}\n\n:::\n\n\n## A Guide to Your Process\n\n### [Scheduling]{.blue}\n\n### [Learning Objectives]{.purple}\n\n### [Practice]{.pink}\n\n### [Supporting Information]{.orange}\n\n### [Class Discussion]{.gold}\n\n## [Today's Plan]{.blue}\n\n- Muddiest Point Review\n- Data Visualization with `ggplot2`\n - Editing `theme` elements\n- Multi-Panel Graphs\n- GitHub Presence Check-Ins (1-on-1)\n - _Not_ graded! Don't stress!\n\n## [Today's Learning Objectives]{.purple}\n\nAfter today's session you will be able to:\n\n. . .\n\n- Modify background elements in a `ggplot2` graph\n- Create publication-quality figures with `ggplot2`\n- Explain the difference between plot faceting and plot grids\n\n## [Muddiest Point Review]{.gold}\n\n- Recurring topics from most recent MPs:\n\n\\\n\n. . .\n\n- What other topic(s) would you like to review?\n\n## [`ggplot2` Review]{.orange} {.smaller}\n\n- ggplots require: (1) data, (2) aesthetics, (3) geometries\n - Optionally can mess with `theme` parameters\n\n. . .\n\n\n::: {.cell layout-align=\"center\"}\n::: {.cell-output-display}\n![](slides_6b_files/figure-revealjs/ex-graph-v7-1.png){fig-align='center' width=576}\n:::\n:::\n\n\n## [Theme Internal Structure]{.orange} {.smaller}\n\n- Theme is composed of [elements]{.purple}\n\n\\\n\n- Elements can be modified as desired inside of `theme` function\n\n\\\n\n- Each type of element has a different 'helper function' needed to modify that element\n - Change text = use `element_text`\n - Change line = use `element_line`\n - _Remove_ an element with `element_blank`\n\n## [Theme Syntax]{.orange} {.smaller}\n\n- You use the `theme` function _once_ with as many `element_...` functions as you need\n\n\\\n\n- Here's an example of the proper syntax\n```{.r}\n# Make a simple scatterplot\nggplot(data = my_df, mapping = aes(x = x_var, y = y_var)) +\n geom_point() +\n # Modify its theme to make the axis font size bigger\n theme(axis.text = element_text(size = 20),\n # Also remove the grid lines\n panel.grid = element_blank())\n```\n\n\\\n\n. . . \n\n- Note how the `theme` and `element_...` functions are used together\n\n## [Gridline Theme Components]{.orange} {.smaller}\n\n- You'll learn theme element names as you work more with `ggplot2`\n\n\\\n\n. . . \n\n- Here are a few broadly relevant ones:\n - Gridlines = `panel.grid`\n - Plot background = `panel.background`\n - Axis lines (X & Y) = `axis.line`\n\n## [Get Ready]{.pink} {.smaller}\n\n![](images/hex-ggplot2.png){.absolute top=0 left=1100 width=\"12%\"}\n\n1. Create a script for this week\n\n\\\n\n2. Load `ggplot2`\n\n\\\n\n3. Read \"minnow.csv\" into R and check the structure!\n\n\\\n\n4. Copy the _final_ graph we made last time\n\n\\\n\n5. Assign the graph to an object\n\n## [Remove Gridlines]{.pink} {.smaller}\n\n![](images/hex-ggplot2.png){.absolute top=0 left=1100 width=\"12%\"}\n\n- To that graph, add the following code:\n - `theme(panel.grid = element_blank())`\n\n\\\n\n- What does this do to your graph?\n\n\\\n\n- What happens if you add these two lines as well (**inside** of the `theme` parentheses!)?\n - `panel.background = element_blank()`\n - `axis.line = element_line(color = \"black\"))`\n\n## [Remove Gridlines]{.pink} {.smaller}\n\n![](images/hex-ggplot2.png){.absolute top=0 left=1100 width=\"12%\"}\n\n::::{.columns}\n:::{.column width=\"50%\"}\n\n\n::: {.cell}\n::: {.cell-output-display}\n![](slides_6b_files/figure-revealjs/ex-graph-v8a-1.png){width=960}\n:::\n:::\n\n\n:::\n:::{.column width=\"50%\"}\n\n\n::: {.cell}\n::: {.cell-output-display}\n![](slides_6b_files/figure-revealjs/ex-graph-v8b-1.png){width=960}\n:::\n:::\n\n\n:::\n::::\n\n## [Changing Text Size]{.orange} {.smaller}\n\n- We can also modify text size inside of `theme`\n\n\\\n\n. . . \n\n- Axis \"[title]{.purple}\" vs. axis \"[text]{.gold}\"\n - `axis.title` = axis label text (given to `labs` function)\n - `axis.text` = text on axis tick marks\n\n\\\n\n. . . \n\n![](images/graph-title-v-text.png){.absolute top=80 left=750 width=\"40%\"}\n\n. . . \n\n- Want to modify just X or Y? Add that to the element name!\n - E.g., `theme(axis.text.x = element_text(...))`\n\n\\\n\n. . . \n\nIncrease font size with: `element_text(size = 14)`\n\n## [Change Text Size]{.pink} {.smaller}\n\n![](images/hex-ggplot2.png){.absolute top=0 left=1100 width=\"12%\"}\n\n- Take your most recent graph\n - No gridlines, no background gray square, black axis lines\n\n\\\n\n. . .\n\n- And make the following tweaks:\n - Make the axis _title_ font size 15\n - Make the axis _text_ font size 13\n\n\\\n\n. . .\n\n- What does that leave you with?\n\n## [Change Text Size]{.pink} {.smaller}\n\n![](images/hex-ggplot2.png){.absolute top=0 left=1100 width=\"12%\"}\n\n\n::: {.cell layout-align=\"center\"}\n::: {.cell-output-display}\n![](slides_6b_files/figure-revealjs/ex-graph-v9-1.png){fig-align='center' width=576}\n:::\n:::\n\n\n## [Customizing Legend]{.orange} {.smaller}\n\n- You can also customize the plot legend in the `theme` function!\n - Legend placement = `legend.position`\n - Legend title = `legend.title`\n\n\\\n\n. . .\n\n- `legend.position` works differently than most other elements!\n - Instead of wanting `element_...` it wants `c(, )`\n - Positions range from 0 (left / bottom) to 1 (right / top)\n\n## [Customizing Legend Syntax]{.orange} {.smaller}\n\n- Check out an example where we put the legend in the middle of the plot\n```{.r}\n# Example scatterplot\nggplot(data = my_df, mapping = aes(x = x_var, y = y_var)) +\n geom_point() +\n # With legend in the middle of the space\n theme(legend.position = c(0.5, 0.5))\n```\n\n\\\n\n. . .\n\n- That graph would have the legend in both:\n - the center (left / right)\n - the middle (top / bottom)\n\n## [Customize Legend]{.pink} {.smaller}\n\n![](images/hex-ggplot2.png){.absolute top=0 left=1100 width=\"12%\"}\n\n- To the graph you created last practice:\n - Remove the legend title\n - Experiment with legend placement until you’re happy\n\n\\\n\n- You may put the legend wherever you'd like _but_:\n - It should not overlap any points / boxplots\n\n\\\n\n- What does _that_ graph look like?\n\n## [Customize Legend]{.pink} {.smaller}\n\n![](images/hex-ggplot2.png){.absolute top=0 left=1100 width=\"12%\"}\n\n\n::: {.cell layout-align=\"center\"}\n::: {.cell-output-display}\n![](slides_6b_files/figure-revealjs/ex-graph-v10-1.png){fig-align='center' width=576}\n:::\n:::\n\n\n## [Temperature Check]{.purple}\n\n#### How are you Feeling?\n\n

\n\"Comic-style\n

\n\n## [Multi-Panel Background]{.orange} {.smaller}\n\n::::{.columns}\n:::{.column width=\"65%\"}\n- Sometimes nice to have multiple graphs next to each other\n - Makes direct comparison easier\n - Journals have limits on number of figures but multi-panels still count as 1\n\n\\\n\n- Two methods (for ggplots):\n 1. `ggplot2::facet_...`\n 2. `cowplot::plot_grid()`\n\n:::\n:::{.column width=\"35%\"}\n\n\"Three\n\n:::\n::::\n\n## [Facted Graphs]{.orange} {.smaller}\n\n- `ggplot2` has an internal way of handling this called [facets]{.purple}\n\n\\\n\n- Facets work just like geometries\n - You get separate plots for each level of the facet variable\n\n\\\n\n- Facets must _all_ be the same plot type and _have identical axes_\n - Sometimes not an issue but good to keep in mind!\n\n## [Fact Syntax]{.orange} {.smaller}\n\n- To facet into 1 row x many columns:\n```{.r}\n# Example scatterplot\nggplot(data = my_df, mapping = aes(x = x_var, y = y_var)) +\n geom_point() +\n # Facet into rows of some other variable\n facet_grid(. ~ facet_variable)\n```\n\n\\\n\n. . .\n\n- To facet into many rows x 1 column:\n```{.r}\n# Example scatterplot\nggplot(data = my_df, mapping = aes(x = x_var, y = y_var)) +\n geom_point() +\n # Facet into rows of some other variable\n facet_grid(facet_variable ~ .)\n```\n\n## [Facet Example]{.orange} {.smaller}\n\n![](images/hex-penguins.png){.absolute top=0 left=1100 width=\"12%\"}\n![](images/hex-ggplot2.png){.absolute top=0 left=965 width=\"12%\"}\n\n- `facet_grid(. ~ island)`\n\n\n::: {.cell layout-align=\"center\"}\n::: {.cell-output-display}\n![](slides_6b_files/figure-revealjs/ex-facet-1.png){fig-align='center' width=576}\n:::\n:::\n\n\n## [Facet]{.pink} {.smaller}\n\n![](images/hex-ggplot2.png){.absolute top=0 left=1100 width=\"12%\"}\n\n- Using the fish data, make a new graph that:\n - Has nest _diameter_ on the X axis\n - Has nest _depth_ on the Y axis\n - Is a scatterplot\n - Faceted by species\n - Plus any additional `theme` tweaks you want to make!\n\n\\\n\n- What does your plot look like?\n\n## [Facet]{.pink} {.smaller}\n\n![](images/hex-ggplot2.png){.absolute top=0 left=1100 width=\"12%\"}\n\n\n::: {.cell layout-align=\"center\"}\n::: {.cell-output-display}\n![](slides_6b_files/figure-revealjs/ex-graph-v11-1.png){fig-align='center' width=576}\n:::\n:::\n\n\n## [Plot Grids]{.orange} {.smaller}\n\n- Facets work great when all panels are the same\n - What about when you have several types of graph?\n\n\\\n\n. . . \n\n- `cowplot::plot_grid` lets you put multiple different graphs together\n\n\\\n\n. . . \n\n- Have to make graphs _separately_ first, _then_ combine them\n\n\\\n\n. . . \n\n- Example syntax: \n - `cowplot::plot_grid(plot1, plot2, ncol = 1, nrow = 2)`\n - A lot of other optional arguments\n\n## [Plot Grid Example]{.orange} {.smaller}\n\n\n::: {.cell layout-align=\"center\"}\n::: {.cell-output-display}\n![](slides_6b_files/figure-revealjs/ex-multi-panel-1.png){fig-align='center' width=960}\n:::\n:::\n\n\n## [Plot Grids]{.pink} {.smaller}\n\n![](images/hex-cowplot.png){.absolute top=0 left=1100 width=\"12%\"}\n![](images/hex-ggplot2.png){.absolute top=0 left=965 width=\"12%\"}\n\n- Make two graphs using the fish data:\n\n1. Copy your faceted graph of diameter vs. depth\n - But remove the facet by species\n\n2. Make a boxplot with flow on the y-axis and species on the x-axis\n\n\\\n\n- Using `plot_grid`, make a multi-panel graph with these two graphs\n - Make them side by side (I.e., 2 columns, 1 row)\n\n## [Plot Grids]{.pink} {.smaller}\n\n![](images/hex-cowplot.png){.absolute top=0 left=1100 width=\"12%\"}\n![](images/hex-ggplot2.png){.absolute top=0 left=965 width=\"12%\"}\n\n\\\n\\\n\n\n::: {.cell layout-align=\"center\"}\n::: {.cell-output-display}\n![](slides_6b_files/figure-revealjs/ex-graph-v12-1.png){fig-align='center' width=960}\n:::\n:::\n\n\n## [Temperature Check]{.purple}\n\n#### How are you Feeling?\n\n

\n\"Comic-style\n

\n\n## [GitHub Presence FAQ]{.orange} {.smaller}\n\n- Worth 40 pts (16% course grade)\n\n\\\n\n- Checklist-style rubric on Canvas\n\n\\\n\n- Due [day before _last_ lab]{.blue}\n\n\\\n\n- Can basically finish all of it now though if you want!\n\n## [GitHub Presence Assignment]{.orange} {.smaller}\n\n- This assignment will seriously help in interviews / job apps!\n - Shows how good of a data scientist you are\n\n\\\n\n. . .\n\n- I don't want anyone caught unawares by this assignment\n - So I'll meet with each of you 1-on-1 today to see where you're at so far\n\n\\\n\n. . .\n\n- Good chance for you to ask any questions you have!\n - Also lets me give you tips for success\n\n## [Upcoming Due Dates]{.blue} {.smaller}\n\n::::{.columns}\n:::{.column width=\"50%\"}\n\n### Due before lecture\n\n#### (By midnight)\n\n- Homework \\#6\n\n:::\n:::{.column width=\"50%\"}\n\n### Due before lab\n\n#### (By midnight)\n\n- Muddiest Point \\#7\n- Submit [Draft 2]{.pink} of Function Tutorials\n - Double check rubric to see that you're not leaving any points on the table!\n - Remember to also submit the Revision Response\n\n:::\n::::\n\n## [GitHub 1-on-1s]{.gold} {.smaller}\n\n- Stick around until we do our 1-on-1\n\n\\\n\n- After you have met with me you can leave\n - Though you're welcome to stay and work on Homework \\#6 / course assignments!\n\n\\\n\n- Any volunteers to go first?\n", "supporting": [ "slides_6b_files" ], diff --git a/_freeze/materials/slides_6b/figure-revealjs/ex-multi-panel-1.png b/_freeze/materials/slides_6b/figure-revealjs/ex-multi-panel-1.png index b00ecfb..faafffd 100644 Binary files a/_freeze/materials/slides_6b/figure-revealjs/ex-multi-panel-1.png and b/_freeze/materials/slides_6b/figure-revealjs/ex-multi-panel-1.png differ diff --git a/data.qmd b/data.qmd index a5b4c8b..ec03e48 100644 --- a/data.qmd +++ b/data.qmd @@ -2,7 +2,6 @@ title: "Example Data" format: html: default - pdf: default --- ## Datasets Overview diff --git a/index.qmd b/index.qmd index c9474f6..3e5ff8b 100644 --- a/index.qmd +++ b/index.qmd @@ -2,7 +2,6 @@ title: "R Programming for Biologists Syllabus" format: html: default - pdf: default --- ## Course Description diff --git a/keys.qmd b/keys.qmd index 680ab19..63ade4d 100644 --- a/keys.qmd +++ b/keys.qmd @@ -2,7 +2,6 @@ title: "Homework Answer Keys" format: html: default - pdf: default --- ## Keys Overview diff --git a/materials/home_week1.qmd b/materials/home_week1.qmd index 2e9c483..321dca6 100644 --- a/materials/home_week1.qmd +++ b/materials/home_week1.qmd @@ -2,7 +2,6 @@ title: "Week 1 Slide Decks" format: html: default - pdf: default --- ## Overview diff --git a/materials/home_week2.qmd b/materials/home_week2.qmd index 32fb77a..1680f9f 100644 --- a/materials/home_week2.qmd +++ b/materials/home_week2.qmd @@ -2,7 +2,6 @@ title: "Week 2 Slide Decks" format: html: default - pdf: default --- ## Overview diff --git a/materials/home_week3.qmd b/materials/home_week3.qmd index ff2779f..b2269ac 100644 --- a/materials/home_week3.qmd +++ b/materials/home_week3.qmd @@ -2,7 +2,6 @@ title: "Week 3 Slide Decks" format: html: default - pdf: default --- ## Overview diff --git a/materials/home_week4.qmd b/materials/home_week4.qmd index 1c71f7b..84c6ef0 100644 --- a/materials/home_week4.qmd +++ b/materials/home_week4.qmd @@ -2,7 +2,6 @@ title: "Week 4 Slide Decks" format: html: default - pdf: default --- ## Overview diff --git a/materials/home_week5.qmd b/materials/home_week5.qmd index 7598459..c756a60 100644 --- a/materials/home_week5.qmd +++ b/materials/home_week5.qmd @@ -2,7 +2,6 @@ title: "Week 5 Slide Decks" format: html: default - pdf: default --- ## Overview diff --git a/materials/home_week6.qmd b/materials/home_week6.qmd index c37c47b..deeb328 100644 --- a/materials/home_week6.qmd +++ b/materials/home_week6.qmd @@ -2,7 +2,6 @@ title: "Week 6 Slide Decks" format: html: default - pdf: default --- ## Overview diff --git a/materials/home_week7.qmd b/materials/home_week7.qmd index ca3279b..cd179ed 100644 --- a/materials/home_week7.qmd +++ b/materials/home_week7.qmd @@ -2,7 +2,6 @@ title: "Week 7 Slide Decks" format: html: default - pdf: default --- ## Overview diff --git a/materials/home_week8.qmd b/materials/home_week8.qmd index 6b62cd7..0383ad8 100644 --- a/materials/home_week8.qmd +++ b/materials/home_week8.qmd @@ -2,7 +2,6 @@ title: "Week 8 Slide Decks" format: html: default - pdf: default --- ## Overview diff --git a/readings.qmd b/readings.qmd index 396dda2..2471685 100644 --- a/readings.qmd +++ b/readings.qmd @@ -2,7 +2,6 @@ title: "Course Readings" format: html: default - pdf: default --- ## Readings Overview diff --git a/rubrics/rubric_github.qmd b/rubrics/rubric_github.qmd index 599ca34..d5f91cb 100644 --- a/rubrics/rubric_github.qmd +++ b/rubrics/rubric_github.qmd @@ -2,7 +2,6 @@ title: "GitHub Presence Rubric" format: html: default - pdf: default --- ## Learning Objective(s) diff --git a/rubrics/rubric_homework.qmd b/rubrics/rubric_homework.qmd index 1121942..1113acb 100644 --- a/rubrics/rubric_homework.qmd +++ b/rubrics/rubric_homework.qmd @@ -2,7 +2,6 @@ title: "Homework Rubric" format: html: default - pdf: default --- ## Learning Objective(s) diff --git a/rubrics/rubric_muddiest-point.qmd b/rubrics/rubric_muddiest-point.qmd index 77c1475..7ab8e1d 100644 --- a/rubrics/rubric_muddiest-point.qmd +++ b/rubrics/rubric_muddiest-point.qmd @@ -2,7 +2,6 @@ title: "Muddiest Point Rubric" format: html: default - pdf: default --- ## Learning Objective(s) diff --git a/rubrics/rubric_tutorials.qmd b/rubrics/rubric_tutorials.qmd index 7c37c03..dda4e89 100644 --- a/rubrics/rubric_tutorials.qmd +++ b/rubrics/rubric_tutorials.qmd @@ -2,7 +2,6 @@ title: "Function Tutorials Rubric" format: html: default - pdf: default --- ## Learning Objective(s)