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.

Building Stories With Data - Optimising the use of colours for storytelling in a spaghetti plot

This article provides guidance on enhancing storytelling in spaghetti plots by optimizing color usage. It discusses data visualization challenges specific to plots with multiple overlapping trend lines, making them difficult to read. Aimed at helping a client who frequently uses these plots, it details strategies to improve clarity and convey stories more effectively. Specifically, the article focuses on altering the 'Orange' dataset in R, including adding fictitious data for illustration. It includes code snippets to modify the dataset, create plots with ggplot2, and improve interpretability by decluttering and selecting harmonious colors, inspired by Piccia Neri's painting.

Go to Resource

Burst Reporting On A Budget

Joe Kirincic introduces a cost-effective solution for burst reporting, using R to automate the creation of customized PDF reports for therapists reviewing patient treatment information. Burst reporting generates individual reports for each data subset, aiding in legal compliance and practicality. This post presents a case study on creating stylish reports with Quarto and Typst, implementing burst reporting via an R script, and improving performance with {mirai} parallelization. Intermediate knowledge of these tools is assumed, with a dataset from the {contoso} package illustrating corporate data scenarios, focusing on a sales table example.

Go to Resource

Calculating and Analyzing Measures of Deprivation in the United States with deprivateR

deprivateR is an R package designed to provide a unified API for calculating and accessing various socioeconomic deprivation indices in the United States, such as the Area Deprivation Index (ADI), Neighborhood Deprivation Index (NDI), and Social Vulnerability Index (SVI), along with the Gini Coefficient. It offers a straightforward interface to compare indices across years and geographies, useful in research and public health. Though valuable, users should note some indices have limited validation for certain Census geographies. The package is available on CRAN and GitHub for easy installation and includes core functions like dep_get_index() and dep_calc_index() for computing deprivation scores using data like the American Community Survey.

Go to Resource

Charting 'tidycensus' data with R

This blog post by USGS Vizlab discusses how to use the 'tidycensus' R package to download and visualize U.S. Census Bureau data. It highlights visualizations such as line charts, bubble maps, cartograms, geofaceted area plots, rainfall plots, and grid charts. The post includes code examples and downloadable functions from GitHub to replicate these visualizations using data on 'households lacking plumbing' from the 2022 and 2023 ACS. It offers a practical guide for users interested in creating similar visualizations for demographic and socioeconomic data within the United States.

Go to Resource

Chat with Large Language Models • {ellmer}

The 'ellmer' package facilitates the use of large language models (LLMs) directly from R. It provides access to multiple LLM providers and features like streaming outputs and structured data extraction. 'ellmer' supports models such as Anthropic's Claude, AWS Bedrock, and OpenAI's GPT, among others. The package offers interactive and programmatic ways to converse with models, maintaining the conversation state, which is useful for building on previous interactions. 'ellmer' is practical for both organizational and personal use, accommodating various IT restrictions and preferences.

Go to Resource
Screenshot of Choropleth Map with Bar Chart in R – the R Graph Gallery

Choropleth Map with Bar Chart in R – the R Graph Gallery

This R Graph Gallery tutorial demonstrates how to create a choropleth map combined with a bar chart in R, using ggplot2 and the patchwork package. The tutorial includes steps and code snippets for data import, manipulation, and visualization. It focuses on visualizing the Human Development Index (HDI) across subregions of Sao Paulo, Brazil. The post introduces binning of continuous variables, customizing plots, theming, and handling geospatial data with the sf package. It also walks through calculating population proportions by HDI groups. Data for the tutorial is hosted on GitHub.

Go to Resource

Cleaning Biodiversity Data in R

This content is a specialized resource for ecology and biodiversity data professionals, detailing processes for cleaning geo-referenced biodiversity data in R. Tailored specifically for ecological data, the guide goes beyond general cleaning techniques to address unique challenges in biodiversity datasets. It's freely available under a CC BY-NC-ND license, emphasizing the book's accessibility and adherence to sharing protocols. The authors acknowledge the lands and environmental know-how of Indigenous Australian peoples, showing sensitivity to cultural heritage in data practices.

Go to Resource

Code review for statisticians, data scientists & modellers – Jack Kennedy

This content provides guidance on code review practices suitable for data scientists, statisticians, and modelers, particularly those who are not primarily software developers but write code for statistical models, data-driven products, and data engineering. It covers the principles of code review, the process of annotating and commenting on code via pull requests on GitHub, and the importance of offering constructive feedback. The author aims to communicate effective code review practices to analytical professionals, with a bias towards the R language and GitHub, while asserting that the underlying concepts are pertinent regardless of specific tools used.

Go to Resource
Screenshot of colorblindcheck

colorblindcheck

Check Color Palettes for Problems with Color Vision Deficiency

Go to Resource
Screenshot of colorblindr

colorblindr

An R package to simulate colorblindness on R figures.

Go to Resource
Screenshot of Colormeter Guide Extension • ggcolormeter

Colormeter Guide Extension • ggcolormeter

The ggcolormeter package provides a single function guide_colormeter() which is a ggplot2 color/fill legend guide extension in the style of a dashboard meter.

Go to Resource
Screenshot of colorspace: A Toolbox for Manipulating and Assessing Colors and Palettes

colorspace: A Toolbox for Manipulating and Assessing Colors and Palettes

colorspace is a toolbox for manipulating and assessing colors and palettes in the R language. It provides utilities for computing with color spaces, such as converting between different color models. The package also includes predefined color palettes and functions for creating customized palettes. It can be used for visualizations and choosing colors in data analysis and graphic design.

Go to Resource