data_context.ggplot: Retrieve Data Context of ggplot

View source: R/mapframe.R

data_context.ggplotR Documentation

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 class 'ggplot'
data_context(x, ...)

Arguments

x

ggplot

...

ignored

Value

data.frame

See Also

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


yamlet documentation built on Jan. 10, 2026, 9:07 a.m.