makeFeatureSet: Construct an ObjFeatureSet.

Description Usage Arguments Value Functions Examples

Description

The generic function for transforming an R object into the appropriate subclass of FeatureSet. This includes most introspection-based metadata extraction from the object. Metadata extraction can be customized at the package/R sesion level for specific classes of objects by defining methods for this generic.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
makeFeatureSet(object, ...)

## S4 method for signature 'ggplot'
makeFeatureSet(object, ...)

## S4 method for signature 'trellis'
makeFeatureSet(object, ...)

## S4 method for signature 'gTree'
makeFeatureSet(object, ...)

## S4 method for signature 'recordedplot'
makeFeatureSet(object, ...)

## S4 method for signature 'expression'
makeFeatureSet(object, ...)

## S4 method for signature 'call'
makeFeatureSet(object, ...)

## S4 method for signature 'FeatureSet'
makeFeatureSet(object, ...)

## S4 method for signature 'ANY'
makeFeatureSet(object, ...)

## S4 method for signature 'data.frame'
makeFeatureSet(object, ...)

Arguments

object

The plot to summarize via metadata in an ObjFeatureSet (or subclass)

...

Other named arguments that become slots in the new PlotFeatureSet.

Value

PlotFeatureSet S4 object containing a ObjFeatureSet object and extracted plot features

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
library(ggplot2)
mt = datasets::mtcars
pg <- ggplot(mt, aes(wt, mpg)) + geom_point()
pfs <- makeFeatureSet(pg)

library(lattice)
titan <- datasets::Titanic
pl <- barchart(Class ~ Freq | Sex + Age, data = as.data.frame(titan),
               groups = Survived, stack = TRUE, layout = c(4, 1),
               auto.key = list(title = "Survived", columns = 2))
pfs <- makeFeatureSet(pl)

dffs <- makeFeatureSet(as.data.frame(titan))

## Not run: 
plot(1:10, 1:10)
pb <- recordPlot()
pfs <- makeFeatureSet(pb)

## End(Not run)

gmbecker/recordr documentation built on May 24, 2021, 10:59 a.m.