FunSideBoxplots: Side Boxplots

View source: R/FunSideBoxplots.R

FunSideBoxplotsR Documentation

Side Boxplots

Description

Takes any vector of p values and returnes the vector in asterisk notation with p<0.05 (*), <0.01 (**), and <0.001 (***)

Usage

FunSideBoxplots(
  x = rnorm(10, 10, 2),
  y = rnorm(10, 12, 2),
  separator = NULL,
  col = "white",
  x_start = 0.55,
  y_start = 0.65,
  main = "",
  ylim = NULL,
  xlim = NULL
)

Arguments

x

variable on x axis

y

variable on y axis

separator

factor which separates the observations in two groups

col

color to fill boxplots

x_start, y_start

startpoint of ploting region for boxplot in normalized device coordinates (see par(fig))

main

title of plot

ylim

lower and upper limit on y axis. Should be the same as in the scatterplot

xlim

lower and upper limit on x axis. Should be the same as in the scatterplot

Value

sideboxplots

Examples

df <- data.frame(x = c(rnorm(80, 10,2), rnorm(20, 7, 2)),
                 y = c(rnorm(100,80,10)),
                 myfac = c(rep(c("a"), 80), rep("b", 20)))
opar <- par(fig=c(0,0.8,0,0.8), new = F, mar = c(6,5,3,2)+0.1)
plot(df$x, df$y, pch = c(17:16)[df$myfac], col = c("red", "blue")[df$myfac])
FunSideBoxplots(x = df$x, y = df$y, separator = df$myfac,
                col = c("red","blue"))
par(opar)

retodomax/FunRZ documentation built on July 30, 2023, 6:42 p.m.