info: Info

Description Usage Arguments Examples

Description

Add informational elements to the chart.

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
info_line(g2, ..., data = NULL, figures = NULL, inherit_asp = TRUE)

info_vline(g2, ..., data = NULL, figures = NULL, inherit_asp = TRUE)

info_hline(g2, ..., data = NULL, figures = NULL, inherit_asp = TRUE)

info_text(g2, ..., data = NULL, figures = NULL, inherit_asp = TRUE)

info_image(g2, ..., data = NULL, figures = NULL, inherit_asp = TRUE)

info_region(g2, ..., data = NULL, figures = NULL, inherit_asp = TRUE)

info_html(g2, ..., data = NULL, figures = NULL, inherit_asp = TRUE)

info_arc(g2, ..., data = NULL, figures = NULL, inherit_asp = TRUE)

info_data_marker(g2, ..., data = NULL, figures = NULL,
  inherit_asp = TRUE)

info_region_filter(g2, ..., data = NULL, figures = NULL,
  inherit_asp = TRUE)

info_data_region(g2, ..., data = NULL, figures = NULL,
  inherit_asp = TRUE)

Arguments

g2

An object of class g2r as returned by g2r.

...

Info options and asp.

data

A data.frame containing data for asp if NULL is inherited from g2.

figures

Vector of names or indices of figure(s) to apply the information to, if NULL applies only to the first figure.

inherit_asp

Whether to inherit aspects from g2r.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
g2(mtcars, asp(mpg, qsec)) %>% 
  fig_point() %>% 
  info_data_marker(
    content = "Marker",
    position = c(20, 20),
    inherit_asp = FALSE
  )

newcars <- cars[1:26,]
newcars$text <- LETTERS

g2(cars, asp(speed, dist)) %>% 
  fig_point() %>% 
  info_text(asp(speed, dist, content = text), data = newcars, offsetY = -20)
 

JohnCoene/g2r documentation built on March 6, 2021, 8:11 p.m.