simple: line for mean + data

Description Usage Arguments Value Examples

View source: R/plotting_functions.R

Description

plots each vector in your list as a group with the data jittered; draws a line for the mean

Usage

1
2
3
simple(data, grouping, lab = NA, point_size = 1.2, line_color = "red",
  line_width = 3, jitter = T, point_col = NA, median = FALSE,
  rug = TRUE, sample_size = T, ...)

Arguments

data

input your data as a list where length(list) = number of groups

lab

labels for groups

point_size

size of points

line_color

color of line for mean

line_width

width of line

jitter

defaults to T

point_col

defeaults to viridis colors

median

plot median? defaults to false

rug

plot 1-D rug plot?

sample_size

defaults to true

ylim

y limits

IQR

include line for IQR? defaults to false

Value

none

Examples

1
2
3
4
5
6
7
8
x <- list(rnorm(40,40,5),rnorm(20,35,2),rnorm(25,41,2)) ; simple(x,main="simple() defaults") # using the defaults
simple(x,jitter=F) # without jitter doesn't look as good
simple(x,line_col="black",point_col=c(ruby,mint,slate),ylab="measurement",xlab="group",lab=c("A","B","C"),rug=T)
x<-list(rnorm(50,50,5),rnorm(30,40,6),rnorm(10,60,2),rnorm(60,50,10),rnorm(30,39,4))
simple(x,point_col=viridis(5),line_color="black",median=T,main="simple() dressed up")
simple(list(rnorm(24,10,2),rchisq(20,5),rexp(40,1/5),runif(40,5,15)),lab=c("normal","chi-squared","exponetial","uniform"),point_col=c(ruby,mint,slate,"goldenrod"),line_color="black",median=T)
simple(list(iris %>% filter(Species=="setosa") %>% .$Sepal.Length, iris %>% filter(Species=="versicolor") %>% .$Sepal.Length, iris %>% filter(Species=="virginica") %>% .$Sepal.Length),lab=c("setosa","versicolor","virginica"),ylab="sepal length",main="simple()",xlab="species")
simple(iris$Sepal.Length,iris$Species) # the simpler way

lukereding/redingPlot documentation built on May 21, 2017, 3:44 p.m.