Learn R Programming

yamlet (version 1.3.2)

data_context.ggplot: Retrieve Data Context of ggplot

Description

Retrieves data context of ggplot as 'data.frame'. calls mapframe.ggplot, and limits this to rows where 'data' is not NA and 'aesthetic' is not duplicated. I.e., for each aesthetic, this function returns the first mapping that has (at least default) data. Such mappings should be what ggplot uses to train the corresponding scales.

Usage

# S3 method for ggplot
data_context(x, ...)

Value

data.frame

Arguments

x

ggplot

...

ignored

See Also

Other decorated_ggplot: data_context(), ggplot.decorated(), ggplot_build.decorated_ggplot(), mapframe(), mapframe.default(), mapframe.ggplot()