get_data: Create cor_tbl extractor function

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/get-data.R

Description

This function returns another function that can extract cor_tbl subset from a cor_tbl object.

Usage

1
get_data(..., type = "full", show.diag = NULL)

Arguments

...

extra filter params, see Details.

type

a string, "full" (default), "upper" or "lower", display full, lower triangular or upper triangular matrix.

show.diag

a logical value indicating whether keep the diagonal.

Details

This function is mainly used in ggplot2 geom_*() functions, where data is filtered based on the ... parameter, then subsets are extracted based on the type and show.diag parameters.

Value

extractor function

Author(s)

Houyun Huang, Lei Zhou, Jian Chen, Taiyun Wei

See Also

filter.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## arrange different elements in upper and lower
quickcor(mtcars) +
  geom_colour(data = get_data(type = "lower")) +
  geom_ellipse2(data = get_data(type = "upper")) +
  add_diag_label() +
  remove_axis()

quickcor(mtcars, cor.test = TRUE) +
  geom_ellipse2(data = get_data(type = "upper")) +
  geom_mark(data = get_data(type = "lower")) +
  add_diag_label() +
  remove_axis()

houyunhuang/ggcor documentation built on July 22, 2020, 8:31 p.m.