Learn R Programming

ggghost (version 0.2.3)

summary.ggghost: List the calls contained in a ggghost object

Description

Summarises a ggghost object by presenting the contained calls in the order they were added. Optionally concatenates these into a single ggplot call.

Usage

# S3 method for ggghost
summary(object, ...)

Value

Either a list of ggplot calls or a string of such concatenated with " + "

Arguments

object

A ggghost object to present

...

Mainly provided for summary.default generic consistency. When combine is passed as an argument (arbitrary value) the list of calls is concatenated into a single string as one might write the ggplot call.

Details

The data is also included in ggghost objects. If this is also desired in the output, use str. See example.

Examples

Run this code
## present the ggghost object as a list
tmpdata <- data.frame(x = 1:100, y = rnorm(100))

z %g<% ggplot(tmpdata, aes(x,y))
z <- z + geom_point(col = "steelblue")
summary(z)

## present the ggghost object as a string
summary(z, combine = TRUE) # Note, value of 'combine' is arbitrary

## to inspect the data structure also captured, use str()
str(z)

Run the code above in your browser using DataLab