action_select_data: Select Data

Description Usage Arguments Examples

View source: R/actions.R

Description

Select a dataset with an input_select().

Usage

1

Arguments

g

An object of class g2r or g2Proxy as returned by g2() or g2_proxy().

input

Id of the input_select() used to choose the dataset.

datasets

A key value pair list where the key is the name of the dataset as listed in the choices of the input_select().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# works in Rmarkdown
input_select(
  "selector",
  "Select a dataset",
  c("Cars", "More Cars")
)

cars1 <- cars
cars2 <- cars + c(1, -4)

g2(cars, asp(dist, speed)) %>%
  fig_point() %>%
  action_select_data(
    "selector",
    datasets = list(
      "Cars" = cars1,
      "More Cars" = cars2
    )
  )

devOpifex/g2r documentation built on Jan. 16, 2022, 12:36 a.m.