box.plot: A box plot function showing pretty box plot and jitter data...

Description Usage Arguments Examples

Description

This function box plot similar to ggplot2 function modified from https://github.com/zonination/perceptions/blob/master/percept.R)

Usage

1
2
3
4
5
box.plot(x, horizontal = TRUE, outline = FALSE, lty = 1, staplewex = 0,
  line = 6, boxwex = 0.8, boxlwd = 1, medlwd = 1, xaxt = "n",
  yaxt = "n", notch = FALSE, mar = c(5, 8, 3, 1),
  xlab = "Assigned Probability %", ylab = "Phrase",
  main = "Perceptions of Probability", cex.main = 1, names = NULL)

Arguments

x

A data frame or matrix showing with cross tabled format,

horizontal

a boolean variable deciding if the box should be horizontal

outline

if an outline

line

when mar changes, ylab should be changed to by line = 3

mar

margin for plot area

main

for title

names

group names, can be entered manually

Examples

1
2
3
4
5
6
7
8
9
set.seed(100)
n <- rnorm(11, 2, 11)
x <-  (matrix(rnorm(15*11, 3, 7), nrow=15, ncol=11) *2)
x2 <- sapply(1:11, function(i) x[,i]+n[i]) 
names <- paste("Var", 1:11, sep =".")
box.plot (x2, horizontal = TRUE, outline = FALSE, lty=1, staplewex=0, 
         boxwex=0.8, boxlwd=1, medlwd=1,xaxt="n", yaxt="n", notch = FALSE,
         mar=c(5,5,3,1), xlab ="Assigned Probability %", ylab = "Phrase",
         main = "Perceptions of Probability", names = names) 

kevinlzheng/RegR documentation built on May 20, 2019, 9:07 a.m.