create.densityplot: Create a density plot.

Description Usage Arguments Value Author(s) Examples

View source: R/create.densityplot.R

Description

A wrapper function for creating density plots using ggplot.

Usage

1
create.densityplot(data = NULL, x = NULL, xlab = NULL, ylab = NULL, group = NULL, group.col = FALSE, group.row = FALSE, filename = NULL, resolution = 1200, width = 8, height = 8, theme = NULL)

Arguments

data

data frame containing data to plot

x

[Str] data frame column name to use in histogram, must be passed as a string

xlab

[Str] label for the x-axis

ylab

[Str] label for the y-axis

group

Dataframe element to use to group bars using facet_grid()

group.col

Boolean to group data for facet_grid() by column

group.row

Boolean to group data for facet_grid() by row

filename

[Str] filename to save plot to, if none is provided, plot goes to STDOUT

resolution

[Int] the resolution of the plot to be passed to write.plot

width

Num] plot width

height

[Num] plot height

theme

[Function] a ggplot2 theme function

Value

Returns a ggplot plot object.

Author(s)

Richard de Borja <richard.deborja@sickkids.ca>

Examples

1
create.densityplot(data=mtcars, x='mpg', xlab='Miles Per Gallon', y='Density')

rdeborja/plotting.general documentation built on May 27, 2019, 3:05 a.m.