plotup {brinton}R Documentation

Returns a ggplot object of a specific graphic explicitly called by name from the ones included in the specimens

Description

Returns a ggplot object of a specific graphic explicitly called by name from the ones included in the specimens

Usage

plotup(data, vars, diagram, output = "plots pane", dir = tempdir())

Arguments

data

Data.frame. Default dataset to use for plot. If not already a data.frame, it should be first coerced to by [as.data.frame()].

vars

Character. A variable within the dataset.

diagram

Character. A specific graphic to be presented within the ones considered by the 'logical', 'ordered', 'factor', 'character', 'datetime' and 'numeric' arguments of the 'wideplot()' function.

output

Character. Type of output.

  • 'html': Creates and displays a html file with the specific graphic.

  • 'plots pane': Default output, a ggplot2 object in RStudio's plots pane.

  • 'console': Prints the code that produces the specific graphic.

dir

Directory in which the files are stored.

Value

This function returns a c('gg', 'ggplot') object, but if the 'output' argument is set to it 'html' or 'console', the function cause a side-effect: either creating and displaying a temporary html file, or printing the ggplot2 code to the console.

See Also

Specimens of graphics for univariate and bivariate data.

Examples

plotup(iris, "Petal.Width", "color heatmap")
plotup(iris, "Petal.Width", "color heatmap", output = "console")
if (interactive()) {
plotup(iris, "Petal.Width", "color heatmap", output = "html")
}

[Package brinton version 0.2.7 Index]