RWEP/_freeze/SD/20240328_3_datavisualize/index/execute-results/html.json

22 lines
93 KiB
JSON
Raw Permalink Normal View History

2024-03-27 23:48:34 +08:00
{
"hash": "1f512aedde0c78d18d7113364c7ce0db",
"result": {
"engine": "knitr",
"markdown": "---\ntitle: \"数据可视化\"\nsubtitle: 《区域水环境污染数据分析实践》<br>Data analysis practice of regional water environment pollution\nauthor: 苏命、王为东<br>中国科学院大学资源与环境学院<br>中国科学院生态环境研究中心\ndate: today\nlang: zh\nformat:\n revealjs:\n theme: dark\n slide-number: true\n chalkboard:\n buttons: true\n preview-links: auto\n lang: zh\n toc: true\n toc-depth: 1\n toc-title: 大纲\n logo: ./_extensions/inst/img/ucaslogo.png\n css: ./_extensions/inst/css/revealjs.css\n pointer:\n key: \"p\"\n color: \"#32cd32\"\n pointerSize: 18\nrevealjs-plugins:\n - pointer\nfilters:\n - d2\nknitr:\n opts_chunk:\n dev: \"svg\"\n retina: 3\nexecute:\n freeze: auto\n cache: true\n echo: true\n fig-width: 5\n fig-height: 6\n---\n\n\n\n\n\n\n## {background-image=\"../../img/concepts/tidyverse-packages-ggplot.png\" background-position=\"center\" background-size=\"100%\"}\n\n\n\n## The ggplot2 Package\n\n<br>\n\n... is an **R package to visualize data** created by Hadley Wickham in 2005\n\n\n::: {.cell}\n\n```{.r .cell-code}\n# install.packages(\"ggplot2\")\nlibrary(ggplot2)\n```\n:::\n\n\n<br>\n\n::: fragment\n... is part of the [`{tidyverse}`](https://www.tidyverse.org/)\n\n\n::: {.cell}\n\n```{.r .cell-code}\n# install.packages(\"tidyverse\")\nlibrary(tidyverse)\n```\n:::\n\n:::\n\n# The Grammar of {ggplot2}\n\n\n\n## The Grammar of {ggplot2}\n\n<br>\n<table style='width:100%;font-size:14pt;'>\n <tr>\n <th>Component</th>\n <th>Function</th>\n <th>Explanation</th>\n </tr>\n <tr>\n <td><b style='color:#67676;'>Data</b></td>\n <td><code>ggplot(data)</code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>\n <td>*The raw data that you want to visualise.*</td>\n </tr>\n <tr>\n <td><b style='color:#67676;'>Aesthetics&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></td>\n <td><code>aes()</code></td>\n <td>*Aesthetic mappings between variables and visual properties.*</td>\n <tr>\n <td><b style='color:#67676;'>Geometries</b></td>\n <td><code>geom_*()</code></td>\n <td>*The geometric shapes representing the data.*</td>\n </tr>\n</table>\n\n\n\n## The Grammar of {ggplot2}\n\n\n<br>\n<table style='width:100%;font-size:14pt;'>\n <tr>\n <th>Component</th>\n <th>Function</th>\n <th>Explanation</th>\n </tr>\n <tr>\n <td><b style='color:#67676;'>Data</b></td>\n <td><code>ggplot(data)</code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>\n <td>*The raw data that you want to visualise.*</td>\n </tr>\n <tr>\n <td><b style='color:#67676;'>Aesthetics&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></td>\n <td><code>aes()</code></td>\n <td>*Aesthetic mappings between variables and visual properties.*</td>\n <tr>\n <td><b style='color:#67676;'>Geometries</b></td>\n <td><code>geom_*()</code></td>\n <td>*The geometric shapes representing the data.*</td>\n </tr>\n <tr>\n <td><b style='color:#67676;'>Statistics</b></td>\n <td><code>stat_*()</code></td>\n <td>*The statistical transformations applied to the data.*</td>\n </tr>\n <tr>\n <td><b style='color:#67676;'>Scales</b></td>\n <td><code>scale_*()</code></td>\n <td>*Maps between the data and the aesthetic dimensions.*</td>\n </tr>\n <tr>\n <td><b style='color:#67676;'>Coordinate System</b></td>\n <td><code>coord_*()</code></td>\n <td>*Maps data into the plane of the data rectangle.*</td>\n </tr>\n <tr>\n <td><b style='color:#67676;'>Facets</b></td>\n <td><code>facet_*()</code></td>\n <td>*The arrangement of the data into a grid of plots.*</td>\n </tr>\n <tr>\n <td><b style='color:#67676;'>Visual Themes</b></td>\n <td><code>theme() / theme_*()</code></td>\n <td>*The overall visual defaults of a plot.*</td>\n </tr>\n</table>\n\n\n\n## The Data\n\n<b style='font-size:2.3rem;'>Bike sharing counts in London, UK, powered by [TfL Open Data](https://tfl.gov.uk/modes/cyclin
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": {
"include-in-header": [
"<script src=\"../../site_libs/jquery-3.6.0/jquery-3.6.0.min.js\"></script>\n<link href=\"../../site_libs/font-awesome-6.4.2/css/all.min.css\" rel=\"stylesheet\" />\n<link href=\"../../site_libs/font-awesome-6.4.2/css/v4-shims.min.css\" rel=\"stylesheet\" />\n<script src=\"../../site_libs/bootbox-5.5.2/bootbox.min.js\"></script>\n<script src=\"../../site_libs/idb-keyvalue-3.2.0/idb-keyval-iife-compat.min.js\"></script>\n<link href=\"../../site_libs/tutorial-0.11.5.9000/tutorial.css\" rel=\"stylesheet\" />\n<script src=\"../../site_libs/tutorial-0.11.5.9000/tutorial.js\"></script>\n<script src=\"../../site_libs/kePrint-0.0.1/kePrint.js\"></script>\n<link href=\"../../site_libs/lightable-0.0.1/lightable.css\" rel=\"stylesheet\" />\n"
],
"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
}
}