The yarrr package contains a mixture of functions and datasets that support my e-book YaRrr! The pirate’s guide to R. The most notable function in the package is pirateplot(). A pirateplot shows the relationship between a categorical independent variable and a numeric dependent variable. However, in contrast to notoriously deceptive barplots, a pirateplot reveals patterns in data by showing Raw data (as points), Descriptive statistics (as lines and/or bars), and Inferential statistics (as bands).

You can install the most stable version of yarrr from CRAN, or the latest developer version from GitHub as follows:

# devtools::install_github("ndphillips/yarrr", build_vignettes = TRUE) # developer version

Here is an example of a pirateplot showing the relationship between the age and weight of chickens:

# Create a pirateplot from the ChickWeight data
yarrr::pirateplot(formula = weight ~ Time,
                  data = ChickWeight,
                  main = "A Pirateplot of chicken weights by time")

The pirateplot() function contains many arguments that allow you to easily customise the look of the plot, from the colors, to the element transparencies. To learn more, look at the pirateplot() vignette on CRAN.