bar: plot categorical x quantitative data as bar plot

Description Usage Arguments Value Examples

Description

plots each vector in your list as a group as a bar plot with the data on top, jittered

Usage

1
2
3
4
bar(sim, lab = rep(c(), length(sim)), CI = F, SE = F,
  bar_color = "grey80", jitter = T, point_col = "#00000080",
  y_limits = NA, median = FALSE, point_size = 1, sample_size = TRUE,
  ...)

Arguments

sim

list of vectors you want to plot

lab

labels for each group

CI

logical. should a 95 percent confidence interval be drawn for each group? defaults to F

SE

logical. should the dtandard errors for each group be drawn? deafults to F

bar_color

color of the bars. can be a vector where length(bar_color) = number of groups

jitter

logical. show the data jittered? defaults to TRUE

point_col

color of the jittered data points

y_limits

limits of the y axis

median

logical. draw median for each group

point_size

size of data points. defaults to 1.0. increase to make the data points bigger.

sample_size

logical. plot sample size under each bar?

...

other arguments to be passed to par()

Value

matrix showing x axis positions of the bars

Examples

1
2
3
4
bar(list(rnorm(20,5),rnorm(15,5)),lab=c("A","B"),xlab="group",ylab="response",jitter=F)
bar(list(rnorm(20,5),rnorm(15,5)),CI=T,lab=c("A","B"),xlab="group",ylab="response",jitter=F,bar_color=viridis(3)[1:2])
bar(list(rnorm(20,5),rnorm(15,5),rnorm(200,50),rnorm(50,1),rnorm(34,19)),CI=T,bar_color=viridis(7)[1:5])
bar(list(rnorm(20,5),rnorm(15,5)),CI=T,lab=c("A","B"),xlab="group",ylab="response",jitter=T,bar_color=viridis(10)[c(3,7)],point_size=1.5)

lukereding/redingPlot documentation built on May 21, 2019, 8:58 a.m.