knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

The goal of this package is to print data summary statistics on a boxplot. This can be done in ggplot2 or in Base R.

library(test.package)

To start, we can plot a function in base R using the box_lbls command.

x <- runif(1000, 0, 10)
box_lbls(x, col = "pink")

This can also be done in ggplot for either class numeric or class 'samantha'. For class 'samantha', the ggboxplot will have notches, which indicate a confidence interval around the median.

x <- runif(1000, 0, 10)
# Class numeric ggplot
g.num <- ggbox_lbls(x) 

# Class Samantha ggplot
class(x) <- "samantha"
g.sam <- ggbox_lbls(x)

require(gridExtra)
grid.arrange(g.num, g.sam, ncol = 2)


sjbothwell/Test_Package documentation built on Sept. 4, 2020, 6:37 p.m.