The pericircle packages
At Perisphere Real World Evidence, we’ve built a set of open-source R packages for the parts of an analysis that take time and cause headache: labeling variables, rounding numbers, keeping figures consistent, organizing projects, and defining conditions with code sets. Each package can be useful on its own, but they work best when they are used together.
From farm data to table → walks through an example that includes building a data dictionary, a characteristics table, a regression table, a figure, and inline statistics.
# install.packages("pak")
pak::pak("perisphere-rwe/pericircle")
library(pericircle) # attaches all of the packages belowperinary
Data dictionaries that do things.
Have you ever noticed how lazy data dictionaries are? They just sit around in your files hoarding all the labels and definitions. No more. With perinary, dictionaries become part of your workflow. Store each variable’s label, units, category labels, display order, and modeling scale in a dictionary object, then apply it anywhere: rename columns, recode categories, rescale model terms, and sort model output into a consistent order.
periglue
Rounding and formatting for tables and text.
peri_glue() inherits the glue() syntax for string interpolation. In addition, it rounds and formats every number it receives. Rounding specifications make it simple to change how the data are rounded when they are passed to periglue functions, and the default rounding behavior can be modified with set_default_rounding_spec.
peripal
A consistent color palette for ggplot2.
A seven-color, warm-to-cool palette built around the Perisphere brand colors, with drop-in scale_color_peripal() and scale_fill_peripal() scales, monochrome gradients, and named diverging presets. For small numbers of groups, it picks colors from the center of the palette outward.
pericircumference
Start every project the same way.
use_pericircumference() sets up a targets pipeline with Perisphere’s templates research projects. Outputs are saved under version numbers, and finalize_version() locks each version and prints its changelog for collaborators. Finalized reports are protected from being overwritten.
peridefs
Validated condition definitions for claims data.
Versioned ICD-9, ICD-10, and HCPCS/CPT code sets and drug-class generic names for conditions such as hypertension, diabetes, heart failure, chronic kidney disease, and atherosclerotic cardiovascular disease. Each code set was developed by experienced claims-data analysts using a standardized procedure. Definitions are provided through functions, and function names are versioned. This ensures a package update never silently changes an existing analysis.
pericircle
Install and load everything at once.
A meta-package modeled on tidyverse. Installing pericircle will install all of the packages above, and running library(pericircle) attaches all of the packages above.
Research software
These packages and tools come from my earlier work at Wake Forest University School of Medicine and the University of Alabama at Birmingham.
aorsf: accelerated oblique random forests
aorsf fits oblique random forests for survival, classification, and regression. It began as the method in my oblique random survival forests paper and became the much faster, interpretable implementation described in Journal of Computational and Graphical Statistics. The package was peer reviewed by rOpenSci, and it can be used on its own or inside tidymodels and mlr3. The oblique random survival forests page collects the papers, the history of the package, and talks in one place.
Recent talks on aorsf
cardioStatsUSA: hypertension statistics for everyone
A free web application for exploring blood pressure and cardiometabolic risk factor trends among US adults in NHANES, developed with the Jackson Heart Study Hypertension Working Group. It is described in Hypertension, and tutorials are available.
r2glmm: R² for mixed models
r2glmm computes R² statistics for fixed effects in generalized linear mixed models, as described in the Journal of Applied Statistics.