ggplot_builder: ggplot_builder function

Description Usage Arguments Examples

View source: R/ggplot_builder.r

Description

This function builds a ggplot2 function to plot data

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
ggplot_builder(d, x = NA, y = NA, geom = "point", facet = NA,
  facet_drop = T, facet_col = T, facet_row = T, smooth = NA,
  smooth.se = T, xlim = NA, ylim = NA, xrotate = 0, colour = NA,
  fill = NA, alpha = NA, text = NA, labels = NA,
  label_display = NA, nudge_y = 0, nudge_x = 0,
  bar.position = "stack", binwidth = 0, bins = 0, outliers = T,
  varwidth = F, enable.plotly = F, theme = "grey", logx = F,
  logy = F, man_colour = NA, man_fill = NA, man_alpha = NA,
  tile_height = NA, tile_width = NA, gradient = "default",
  gradient.trans = "identity", gradient.steps = 10,
  gradient.range = NA, colourset = "default", coord_flip = F,
  cut_method = "number", cut.n = 10, factorlim = 50,
  stat.method = "count", stat.func = "mean")

Arguments

d

Table of data

x, y, z

Variables for each dimension

geom

Select a ggplot2 geometry (currently point,line,histogram,bar,boxplot,violin)

facet

Facet plot by values in a column

facet_drop

Drop faceted panels without values (T)

facet_col

Number of columns (0)

facet_row

Number of rows (0)

smooth

Add a smooth line to point plots (gam,lm,loess,rlm,glm,auto)

xlim

Range displayed on x-axis

ylim

Range displayed on y-axis

xrotate

Angle to rotate x-axis labels (90=vertical)

colour

A variable to colour by

fill

A variable to fill by

alpha

A variable to alpha by

text

Variable to show in plotly when hover over points

labels

Variable to label points by

label_display

vector of labels to display

nudge_y

shift label on y-axis

nudge_x

shift label on x-axis

bar.position

Position of bars in a bar plot (stack,dodge,fill)

binwidth

Size of binwidth in binned plots (histogram)

bins

Add a stat_bin with this number of bins

outliers

Set outliers=F to remove outliers from boxplot

varwidth

Set varwidth=T to plot boxplots with variable width based on dataset size

enable.plotly

convert to interactive Plotly plot

theme

Set ggplot theme (grey,bw,dark,light,void,linedraw,minimal,classsic)

logx, logy

Log the variable first. Defaults to F.

man_colour

Select a solid colour

man_fill

Select a solid fill colour

man_alpha

Select a static alpha value

tile_height

Set height of tile for geom_tile

tile_width

Set width of tile for geom_tile

gradient

Select gradient colour scheme (default,Matlab)

gradient.trans

Transform gradient scale (identity,log,log10,log2,sqrt)

gradient.steps

Set number of shades in gradient

gradient.range

Set range of values covered by gradient

colourset

Select colour scheme (default,Set1,Set2,Set3,Spectral)

coord_flip

Flip the x and y axes (default=F)

cut_method

Select method for binning continuous X axis in boxplots (number,interval,width see cut_interval etc.)

cut.n

Binning number applied to cut_method

factorlim

Set maximum levels allowed to use factors for plotting (default=50)

stat.method

Set stat method for barplots (count,identity,summary) (default=bin)

stat.func

Set summary function for stat.method="summary" (default=mean)

Examples

1

swebb1/quest documentation built on Dec. 18, 2019, 10:33 a.m.