https://github.com/z3tt/advanced-ggplot2-pearson
Material for the Pearson × O’Reilly Live Training Session "Hands-On Guide to Advanced Data Visualization with ggplot2: Custom Design"
https://github.com/z3tt/advanced-ggplot2-pearson
Last synced: 7 days ago
JSON representation
Material for the Pearson × O’Reilly Live Training Session "Hands-On Guide to Advanced Data Visualization with ggplot2: Custom Design"
- Host: GitHub
- URL: https://github.com/z3tt/advanced-ggplot2-pearson
- Owner: z3tt
- Created: 2022-11-09T14:25:27.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-29T09:19:27.000Z (over 1 year ago)
- Last Synced: 2025-03-29T00:05:15.325Z (25 days ago)
- Language: R
- Homepage:
- Size: 6.05 MB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Material for the Pearson Live Training Session for O’Reilly
"Hands-On Guide to Advanced Data Visualization with ggplot2: Custom Design"
This is the second training of a two-part workshop series "Create Data Visualizations in R Using the Grammar of Graphics” in collaboration with Pearson and O'Reilly.
* Part 1: **["Hands–On Data Visualization with ggplot2: Concepts"](https://www.oreilly.com/live-events/hands-on-data-visualization-with-ggplot2-concepts/0636920089879/)** → [Repo](https://github.com/z3tt/fundamentals-ggplot2-pearson/)
* Part 2: **["Hands-On Guide to Advanced Data Visualization with ggplot2: Custom Design"](https://www.oreilly.com/live-events/hands-on-guide-to-advanced-data-visualization-with-ggplot2-custom-design/0636920092434/)** (this course)
## Course Set-up
### Materials
To get a copy of all the material, **clone this repository** to a directory of your choice or **download and unpack [this zip folder](https://github.com/z3tt/advanced-ggplot2-pearson/archive/refs/heads/main.zip)**.
### SoftwareTo run any of the materials locally on your own machine, you will need to install the following:
- A recent version of **R** (download from [here](https://cloud.r-project.org/))
- A recent version of **RStudio** (download from [here](https://rstudio.com/products/rstudio/download/#download))
- A suite of **R packages**:
- ggplot2
- dplyr
- forcats
- stringr
- scales
- systemfonts
- gapminder
- rcartocolor
- prismatic
- ggrepel
- ggforce
- ggtext
- patchwork
- magick
- ggdist
- ggridges
- plotly
- ggiraph
- echarts4r
- gganimateYou can install all required R packages at once by running the following code in the R command line:
```{r install, eval=FALSE, echo=TRUE}
pkgs <- ("ggplot2","dplyr", "forcats", "stringr", "scales", "systemfonts", "gapminder",
"rcartocolor", "prismatic", "ggrepel", "ggforce", "ggtext", "patchwork", "magick",
"ggdist", "ggridges", "plotly", "ggiraph", "echarts4r", "gganimate")
unavailable <- setdiff(pkgs, rownames(installed.packages()))
install.packages(unavailable)
```To run the code, open up Rstudio. Copy–paste the code in the **console pane** (by default in the lower left) and hit enter. Several messages should pop up. Scan these messages that are returned for errors and troubleshoot them if necessary. Warnings and other informational messages can be ignored.
### Fonts
We are using a non-default fonts in this session. If you want to run all code "as it is", please install the following typefaces which are available for free:
- Roboto Condensed
- Open Sans
- Hepta SlabYou find the files in the `fonts` folder. Install them by double-clicking.
If you don't want to or can't install the fonts, it is still possible to run the code. Just make sure to replace the font families in the code with one that is installed on your system--or remove the respective rows (more information during the session).
### For Mac Users
If you want to save your visualization to PDF, please make sure that [XQuartz](https://www.xquartz.org/) is installed which is needed to use the cairo pdf device.
## Run the Codes
**Double-click on the `advanced-ggplot2-pearson.Rproj` file** which opens up Rstudio with the working directory set to the same folder (i.e. the directory where the Rproj file is placed).
Now, you can open any script from the files pane (by default in the lower right).
To follow the training, **open the script `advanced-ggplot2-pearson.R`**.