ezplot: Easy plotting of ggplot2 objects

Description Usage Arguments

Description

Creates a ggplot2 object using greatly simplified syntax

Usage

1
2
3
4
5
ezplot(data, aggr = NULL, plot_type = "col", x, y = NULL, group = NULL,
  position = "identity", facet = NULL, facet_x = NULL, facet_y = NULL,
  palette = NULL, ci = NULL, error_type = "errorbar", error_args = NULL,
  text = FALSE, text_round = function(x) signif(x, 3), text_args = NULL,
  title = NULL, subtitle = NULL, caption = NULL, ...)

Arguments

data

(data.frame | tibble) Data to be used in plot

aggr

(function) (Optional) function created using dplyr::summarise. Must take the form function(x) summarise(x, ...)

plot_type

character(1) Type of plot to create. Default is 'col'

  • 'col' Create column plot using geom_col()

  • 'line' Create line plot using geom_line()

  • 'smooth' Create smoothed line plot using geom_smooth()

  • 'point' Create point plot (scatterplot) using geom_point()

  • 'area' Create area plot using geom_area()

  • 'density' Create density plot using geom_density()

  • 'dotplot' Create dot plot using geom_dotplot()

  • 'freqpoly' Create frequency polygon using geom_freqpoly()

  • 'histogram' Create histogram using geom_histogram()

  • 'rect' Create rectangle plot using geom_rect()

x

Variable to use on X-axis

y

Variable to use on Y-axis

group

(Optional) Variable to group by

position

character(1) How to position grouping. Default is 'identity'

  • 'stack' stacks groups on top of one another, i.e. stacked bar chart

  • 'dodge' places groups side-by-side, i.e. clustered bar chart or butted bar chart

  • 'fill' stacks groups on top of one another and normalizes to the same height. Useful for comparing proportions

  • 'identity' places groups in the same location

facet

(Optional) Variable to facet by using facet_wrap(). Will be ignored if combined with facet_x or facet_y

facet_x

(Optional) Variable to facet by using facet_grid(. ~ x). When combined with facet_y, will facet using facet_grid(y ~ x)

facet_y

(Optional) Variable to facet by using facet_grid(y ~ .). When combined with facet_x, will facet using facet_grid(y ~ x)

palette

(Optional) Color palette to use for fill

ci

(Optional) Confidence interval to use for visualizing error

error_type

(Optional) Type of visualization to use for error. Default is 'errorbar'

  • 'crossbar' Use geom_crossbar()

  • 'errorbar' Use geom_errorbar()

  • 'linerange' Use geom_linerange()

  • 'pointrange' Use geom_pointrange()

error_args

(Optinoal) List of additional arguments to pass to error plotting function

text

logical(1) Show values of y variable as text? Default is 'FALSE'

text_round

function Function to use to round text. Default is function(x) signif(x, 3)

text_args

(Optional) List of additional arguments to pass to geom_text

...

(Optional) Additional parameters to pass to the geom function


Prometheus77/ezplot documentation built on May 26, 2019, 3:35 p.m.