Skip to content

Commit

Permalink
1511 render
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanrongen committed Nov 15, 2024
1 parent 430d2ea commit 252ea4d
Show file tree
Hide file tree
Showing 6 changed files with 34,835 additions and 0 deletions.
17 changes: 17 additions & 0 deletions _freeze/materials/04-plotting/execute-results/html.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"hash": "d4a131e91826a1b7c0f7e8f521c61159",
"result": {
"engine": "knitr",
"markdown": "---\ntitle: Plotting data\n---\n\n\n\n\n::: {.callout-tip}\n#### Learning objectives\n\n- \n:::\n\n## Context\nWe now have a good grasp of how data is commonly structured, with variables in columns and observations in rows. This is the perfect format for visualising data.\n\n## Introducing plotting\n\nTo create a plot we'll need three things:\n\n1. data\n2. mapping aesthetics\n3. specify the type of plot\n\n::: {.panel-tabset group=\"language\"}\n## R\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code code-line-numbers=\"2\"}\nlibrary(tidyverse)\n```\n\n::: {.cell-output .cell-output-stderr}\n\n```\n── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──\n✔ dplyr 1.1.4 ✔ readr 2.1.5\n✔ forcats 1.0.0 ✔ stringr 1.5.1\n✔ ggplot2 3.5.1 ✔ tibble 3.2.1\n✔ lubridate 1.9.3 ✔ tidyr 1.3.1\n✔ purrr 1.0.2 \n── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──\n✖ dplyr::filter() masks stats::filter()\n✖ dplyr::lag() masks stats::lag()\nℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors\n```\n\n\n:::\n\n```{.r .cell-code code-line-numbers=\"2\"}\nsurveys <- read_csv(\"data/surveys.csv\")\n```\n\n::: {.cell-output .cell-output-stderr}\n\n```\nRows: 34786 Columns: 13\n── Column specification ────────────────────────────────────────────────────────\nDelimiter: \",\"\nchr (6): species_id, sex, genus, species, taxa, plot_type\ndbl (7): record_id, month, day, year, plot_id, hindfoot_length, weight\n\nℹ Use `spec()` to retrieve the full column specification for this data.\nℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.\n```\n\n\n:::\n\n```{.r .cell-code code-line-numbers=\"2\"}\nggplot(data = surveys,\n mapping = aes(x = weight, y = hindfoot_length)) +\n geom_point()\n```\n\n::: {.cell-output .cell-output-stderr}\n\n```\nWarning: Removed 4048 rows containing missing values or values outside the scale range\n(`geom_point()`).\n```\n\n\n:::\n\n::: {.cell-output-display}\n![](04-plotting_files/figure-html/unnamed-chunk-1-1.png){width=672}\n:::\n:::\n\n\n\n\n## Python\n\n:::\n\n### Start plotting\n* LO: plotting with ggplot2\n\n### Building up plots\n* LO: layering plots\n\n### Changing plots\n* LO: changing aesthetics (colour, fill, transparency, size)\n\n\n\n## Summary\n\n::: {.callout-tip}\n#### Key points\n\n- \n:::\n",
"supporting": [
"04-plotting_files"
],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": {},
"engineDependencies": {},
"preserve": {},
"postProcess": true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions materials/04-plotting.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ We now have a good grasp of how data is commonly structured, with variables in c

## Introducing plotting

To create a plot we'll need three things:

1. data
2. mapping aesthetics
3. specify the type of plot

::: {.panel-tabset group="language"}
## R


## Python

:::

### Start plotting
* LO: plotting with ggplot2

Expand Down
17 changes: 17 additions & 0 deletions materials/04-plotting_files/execute-results/html.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"hash": "d4a131e91826a1b7c0f7e8f521c61159",
"result": {
"engine": "knitr",
"markdown": "---\ntitle: Plotting data\n---\n\n\n\n\n::: {.callout-tip}\n#### Learning objectives\n\n- \n:::\n\n## Context\nWe now have a good grasp of how data is commonly structured, with variables in columns and observations in rows. This is the perfect format for visualising data.\n\n## Introducing plotting\n\nTo create a plot we'll need three things:\n\n1. data\n2. mapping aesthetics\n3. specify the type of plot\n\n::: {.panel-tabset group=\"language\"}\n## R\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code code-line-numbers=\"2\"}\nlibrary(tidyverse)\n```\n\n::: {.cell-output .cell-output-stderr}\n\n```\n── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──\n✔ dplyr 1.1.4 ✔ readr 2.1.5\n✔ forcats 1.0.0 ✔ stringr 1.5.1\n✔ ggplot2 3.5.1 ✔ tibble 3.2.1\n✔ lubridate 1.9.3 ✔ tidyr 1.3.1\n✔ purrr 1.0.2 \n── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──\n✖ dplyr::filter() masks stats::filter()\n✖ dplyr::lag() masks stats::lag()\nℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors\n```\n\n\n:::\n\n```{.r .cell-code code-line-numbers=\"2\"}\nsurveys <- read_csv(\"data/surveys.csv\")\n```\n\n::: {.cell-output .cell-output-stderr}\n\n```\nRows: 34786 Columns: 13\n── Column specification ────────────────────────────────────────────────────────\nDelimiter: \",\"\nchr (6): species_id, sex, genus, species, taxa, plot_type\ndbl (7): record_id, month, day, year, plot_id, hindfoot_length, weight\n\nℹ Use `spec()` to retrieve the full column specification for this data.\nℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.\n```\n\n\n:::\n\n```{.r .cell-code code-line-numbers=\"2\"}\nggplot(data = surveys,\n mapping = aes(x = weight, y = hindfoot_length)) +\n geom_point()\n```\n\n::: {.cell-output .cell-output-stderr}\n\n```\nWarning: Removed 4048 rows containing missing values or values outside the scale range\n(`geom_point()`).\n```\n\n\n:::\n\n::: {.cell-output-display}\n![](04-plotting_files/figure-html/unnamed-chunk-1-1.png){width=672}\n:::\n:::\n\n\n\n\n## Python\n\n:::\n\n### Start plotting\n* LO: plotting with ggplot2\n\n### Building up plots\n* LO: layering plots\n\n### Changing plots\n* LO: changing aesthetics (colour, fill, transparency, size)\n\n\n\n## Summary\n\n::: {.callout-tip}\n#### Key points\n\n- \n:::\n",
"supporting": [
"04-plotting_files"
],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": {},
"engineDependencies": {},
"preserve": {},
"postProcess": true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 252ea4d

Please sign in to comment.