FastBar: Fast Way to Get a Bar plot based on ggpubr

Description Usage Arguments Value Author(s) See Also Examples

View source: R/base_Fastbar.R

Description

Fastbar help get a barplot of ggplot2 style.

Usage

1
2
3
4
FastBar(data, x, y, order = NULL, fill = "white", color = NULL,
  palette = NULL, label = TRUE, size = 15,
  position = position_stack(), title = "Frequecy", x.lab = "name",
  y.lab = "size", legend.position = "right")

Arguments

data

a data frame

x

x is usually the colnames of symbol/names

y

y is usually the colnames of frequency

order

character vector specifying the order of items

fill

Default is white.Set fill=x is a useful way to enhance visualize barplot and recommanded

color

Default is NULL,and use x as color scale

palette

Default is NULL,and it use a lucky::mycolor color strategy.Or you can set self-defined colors.Note that the number of color you want to set should be the same as the unique number of x

label

Default is TRUE.If variables are too much,you can set FALSE to enhance visualization

size

a size control for plot title,axis titles and labels

position

see ggpubr::ggbarplot

title

the title of the plot

legend.position

the position of legend.you can select "top","left","right" and "none"

Value

a ggplot list

Author(s)

Weibin Huang<654751191@qq.com>

See Also

ggpubr::ggbarplot

Examples

1
2
3
4
5
6
7
## This is a simulative process and NOT RUN
p  <- FastBar(data = df,
              x = "SYMBOL",y = "Freq",
              fill = "SYMBOL",
              title = "Frequecy",
              legend.position = "none",
              size = 20)

shijianasdf/BasicBioinformaticsAnalysisFromZhongShan documentation built on Jan. 3, 2020, 10:08 p.m.