ggboxplot: Draw boxplot based on ggplot2, using data containing grouping...

Description Usage Arguments Value Author(s) Examples

View source: R/ggboxplot.R

Description

Draw boxplot based on ggplot2, using data containing grouping info. Only can draw one valuable. Function 1.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
ggboxplot(
  data,
  variable,
  comparisons = NULL,
  test = "wilcox.test",
  jitter = TRUE,
  y_position = NULL,
  x.text.angle = 30,
  map_signif_level = TRUE,
  tip_length = 0
)

Arguments

data

A dataframe that containing the grouping info and multiple numeric valiabes.

variable

The column that will be used to draw the bar plot.

comparisons

a list that indicated which group to be compared.

test

The method that used for significant test, one of "t.test" and "wilcox.test". The default method is "wilcox.test".

jitter

A boolean value indicates whether add jitters points to the plot. The default value is TRUE.

y_position

A vector shows the values to be used in positions of the results significant tests.

x.text.angle

A numeric number indicated the angle of axix.test.x.

map_signif_level

A logic value

tip_length

the length of tip, default is 0

Value

The ggbarplot

Author(s)

Zhonghui Gai

Examples

1
2
3
4
5
6
7
library(ggplot2)
data <- iris
colnames(data)[5] <- "group"
ggboxplot(data = data, variable = "Petal.Width",
comparisons = list(c("setosa", "versicolor"),
 c("versicolor", "virginica"),
  c("setosa", "virginica"))) +  ggsci::scale_fill_aaas()

ZhonghuiGai/ggroup documentation built on Dec. 18, 2021, 8:28 p.m.