plotBox: plotBox()

Description Usage Arguments Value Note

View source: R/helper_functions.R

Description

Boxplot (ggplot style)

Usage

1
2
plotBox(df, x, y, palette_defined = F, palette = "", title = "",
  log_scale = F, x_angle = 30, text_size = 8, ...)

Arguments

df

A data.frame

x

(str) column to plot x (column name), fill colour by x

y

(str) column to plot y (column name)

palette_defined

(bool) indicate whether to use as named palette list as defined in palette. default = F: use ggplot default colour scheme

palette

[optional] (named str) define the colour of the factor levels

title

[optional] (str) title of the plot, default none

log_scale

(bool) If True, log 10 scale y axis. default = F

x_angle

[optional] (num) angle of x axis labels, default = 30

text_size

(num) plot title size, default = 8

...

other param in the ggplot2::geom_boxplot()

Value

A ggplot boxplot

Note

use palette to define color for the factors. The palette list is a named list of colors. The names are corresponding to the factor levels e.g. palette <- c(red = "#ff0000", blue="#333BFF", pink ="#DD1C77", orange = "#CC6600", purple ="#9633FF",l_blue = "#00ffff", l_green = "#9bbc57", yellow = "#ffe700", salmon = "#ff7856",l_purple = "#e47fff")


BerylZhuang/helper_functions documentation built on March 15, 2021, 5:19 a.m.