ggbarplot: Draw barplot based on ggplot2, using data containg grouping...

Description Usage Arguments Value Author(s) Examples

View source: R/ggbarplot.R

Description

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

Usage

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

Arguments

data

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

variable

The collum that will be used to draw the barplot.

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 jitter 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 numaric number indicated the angle of axix.test.x.

Value

The ggbarplot

Author(s)

Zhonghui Gai

Examples

1
2
3
4
5
6
7
library(ggplot2)
data <- iris
colnames(data)[5] <- "group"
ggbarplot(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.