add_layer_cogs: Add plot layer cognostics

Description Usage Arguments Examples

View source: R/add_layer_cogs.R

Description

Add a new set of cognostic groups for a given plot layer. If the plot layer is found, the corresponding cognostic groups will be calculated.

Usage

1
add_layer_cogs(name, description, cog_groups, kind = "ggplot", ...)

Arguments

name

Name of plot layer. This should match the output of the "name" values of layer_info

description

Description of cognostic group

cog_groups

A data.frame (or tibble) containing the columns: "cog_group", "cols", "name". "cog_group" column should contain a string value of a known cognostic group. "cols" should be a single value or vector of column names to use from the data supplied by layer_info during calculations. "name" should contain the final storage name of the cognostic group.

kind

String value that will match the output of plot_class of the desired plot object

...

ignored

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
add_layer_cogs(
  "geom_point",
  kind = "ggplot",
  "scatter plot points",
  tibble::tribble(
    ~ cog_group, ~ cols, ~ name,
    "univariate_continuous", "x", "_x",
    "univariate_continuous", "y", "_y",
    "bivariate_continuous", c("x", "y"), "_bivar",
    "scagnostics", c("x", "y"), "_scagnostic",
    "bivariate_counts", c("x", "y"), "_n"
  )
)

## End(Not run)

schloerke/autocogs documentation built on June 29, 2018, 10:43 p.m.