Skip to content
R for the Rest of Us Logo

Resources

This carefully curated collection of resources will help you find packages and learning resources to help you on your R journey.

Screenshot of Coloured text in {ggplot2}: {ggtext} vs {marquee}

Coloured text in {ggplot2}: {ggtext} vs {marquee}

This content compares two R packages, {ggtext} and {marquee}, which allow users to add colored text to {ggplot2} visualizations as an alternative to a traditional legend. It discusses the suitability of this approach for categorical data and provides examples using lemur data from Duke Lemar Center. The tutorial includes data wrangling with {dplyr} and creating a scatter plot in {ggplot2}, as well as describing the use of HTML and CSS for text formatting in the {ggtext} package.

Go to Resource
Screenshot of Compute and Visualize Wildfire Exposure • fireexposuR

Compute and Visualize Wildfire Exposure • fireexposuR

fireexposuR is an R package designed for computing and visualizing wildfire exposure with a focus on aiding wildfire management. It automates established methodologies, offers customization for various use cases and geographies, and enables output visualization. Users from varied sectors like research, government, and forestry can benefit, but a solid understanding of wildland fuels, spatial data, and R is recommended. The package ensures accessibility and encourages users to familiarize themselves with the underpinning scientific theories for effective use. It doesn't simplify the complexities of theory, data preparation, or parameter decision-making intrinsic to wildfire exposure assessments.

Go to Resource
Screenshot of Constructing a Baseball Savant Graph

Constructing a Baseball Savant Graph

This content describes a workshop on creating a Baseball Savant graph and replicating its unique graphic style using Gerrit Cole's pitch data as an example. It includes a step-by-step guide on analyzing baseball data using R, from reading Retrosheet data, computing mean runs from game states, graphing expected runs, and finding leaders in total runs value. It also demonstrates how to reproduce the Movement Profile graph from Baseball Savant by manipulating and visualizing pitch movement data. The material, available on GitHub, is designed for those interested in sabermetrics and data visualization in sports analytics.

Go to Resource
Screenshot of Convenience Functions for Working With Non-Calendar Years in R • acadyr

Convenience Functions for Working With Non-Calendar Years in R • acadyr

acadyr is an R package that simplifies the process of working with financial and academic years, which do not follow standard calendar cycles. It provides utility functions to create and manipulate these non-standard year types in R, such as financial_year and academic_year, which help in determining the year based on any given date. The package integrates smoothly with dplyr and ggplot2, and includes a vignette with examples of typical use cases, such as generating summary bar charts of revenues by financial year. While not available from CRAN, acadyr can be installed directly from GitHub.

Go to Resource
Screenshot of Convert a Word table to Markdown

Convert a Word table to Markdown

The blog post describes a function created by the author to convert Microsoft Word tables into Govspeak Markdown, which is needed for publishing HTML files on GOV.UK. This process is typically tedious and demands attention to specific Govspeak features such as row labels and totals columns. The author introduces an R package named {wordup} that includes the function table_to_govspeak(), which handles input, guesses data types, and applies extra styles to the table conversion. It streamlines moving content from Word to Govspeak, which can be further facilitated by copying tables to the clipboard.

Go to Resource
Screenshot of covdata

covdata

covdata is a data package for R that collects and bundles datasets related to the COVID-19 pandemic from a variety of sources.

Go to Resource
Screenshot of cowplot

cowplot

The cowplot package provides various features that help with creating publication-quality figures, such as a set of themes, functions to align plots and arrange them into complex compound figures, and functions that make it easy to annotate plots and or mix plots with images.

Go to Resource
Screenshot of CRAN - Package ggquiver

CRAN - Package ggquiver

An extension of 'ggplot2' to provide quiver plots to visualise vector fields.

Go to Resource
Screenshot of Create Music with R

Create Music with R

The 'gm' package in R enables users to create music by programmatically defining musical elements such as meter and musical lines. It offers an ease of composing music within R. Using functions like 'Music()', 'Meter()', and 'Line()', users can construct and visualize melodies. The package is easily installable from CRAN or GitHub for the development version. Integration with MuseScore, a free notation software, allows for a seamless music notation experience. The 'gm' package is open-source under the MIT license, with detailed documentation available in its vignette.

Go to Resource
Screenshot of Create paint by numbers images

Create paint by numbers images

The 'paintr' GitHub repository hosts an R package for creating paint-by-numbers images. It leverages the 'magick' package for image processing and color picking, and 'sf' and 'rmapshaper' packages for handling image polygons. Users can apply noise reduction, smoothing, and polygon simplification to adjust the image feel. It also allows for custom color palettes. The repository contains examples, including usage with Hadley Wickham's photo, demonstrating how to generate a paint-by-numbers result and apply different palettes for the desired artistic effect.

Go to Resource
Screenshot of Create Sankey and Alluvial Diagrams Using ggplot2 • ggsankeyfier

Create Sankey and Alluvial Diagrams Using ggplot2 • ggsankeyfier

The ggsankeyfier package enhances ggplot2 by allowing the creation of Sankey and Alluvial diagrams, which are types of data visualization that depict the flow of quantities through stages or categories. It provides specialized functions to handle the complex layout of these diagrams, including the ability to model skipped stages or feedback loops. The package defines its own terms for consistency and offers a thesaurus for commonly used Sankey terminology. It can be installed from CRAN or GitHub and is integrated into the ggplot2 workflow, requiring structured data for plotting.

Go to Resource
Screenshot of Create spatial square/hexagon grids and count points inside in R with sf | Urban Data Palette

Create spatial square/hexagon grids and count points inside in R with sf | Urban Data Palette

Create spatial square/hexagon grids and count points inside in R with sf

Go to Resource