prefill_aes: Prefill some aes arguments of a transformer

Description Usage Arguments Examples

View source: R/prefill.R

Description

Prefill some aes arguments of a transformer

Usage

1
prefill_aes(transformer, ...)

Arguments

transformer

A transformer function like vis_2d_point() that should gain prefilled aesthetics.

...

Named aesthetics, e.g. color = "variable_x".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# If you prefill in-place, you need to supply `k_dimensional`, since it
# cannot be inferred from the transformer name itself.
mtcars %>%
  vis_cols(everything(),
    transformer = prefill_aes(vis_2d_point, color = "vs"), k_dimensional = 2
  ) %>%
  pull_gg(-1)
# Alternatively, you explificlty assign the object and give it a name
# that can be recognized by `vis_cols`.
vis_2d_point_with_color <- prefill_aes(vis_2d_point, color = "vs")
mtcars %>%
  vis_cols(everything(),
    transformer = vis_2d_point_with_color, k_dimensional = 2
) %>%
pull_gg(-1)

lorenzwalthert/simplificar documentation built on May 7, 2019, 9:32 a.m.