Skip to content

Instantly share code, notes, and snippets.

@SwampThingPaul
SwampThingPaul / boxplot_example.r
Created January 6, 2020 18:37
A scale-able, reproducible example of boxplot definition.
# Base curly brackets adapted from https://stackoverflow.com/a/9310002/5213091
CurlyBraces <- function(x, y, min.val,max.val, pos = 1, direction = 1 ,b=c(0,.2,.28,.7,.8),a=c(1,2,3,48,50)) {
# a set flexion point for spline
# b set depth for spline flexion point
curve = spline(a, b, n = 50, method = "natural")$y / 2
curve = c(curve,rev(curve))
a_sequence = rep(x,100)