gf_do: Iterate a graphic

Description Usage Arguments Details Examples

Description

Iterate a graphic

Usage

1
gf_do(formula, what, ntrials = 3, data, start = NULL, ...)

Arguments

data

a data table or, more usually, an expression that produces a data table, e.g. mosaic::resample(CPS85)

Details

It makes sense to use this only for graphics that do a substantial calculation on the data.

Examples

1
2
3
4
5
6
7
8
9
gf_do(wage ~ sector + color:sex + alpha:.1, gf_boxplot,
  data = mosaic::resample(CPS85), ntrials = 10)
gf_do(~ wage + color:sex + alpha:.05, gf_freqpoly,
  data = mosaic::resample(CPS85), ntrials = 10)
gf_do(wage ~ sex + alpha:.05, gf_violin,
  data = mosaic::resample(CPS85), ntrials = 10)
gf_do(~ wage  + fill:sex + alpha:.05, gf_histogram,
  data = mosaic::resample(CPS85), ntrials = 50) %>%
  gf_facet_wrap(~sex)

dtkaplan/statPREPpackage documentation built on May 15, 2019, 5:22 p.m.