sel_text: Create a dynamic text object

Description Usage Arguments Value Examples

View source: R/sel_text.R

Description

Create a dynamic text object

Usage

1
2
3
sel_text(sel_id = "ts_1", options = list(Option_1 =
  "The first option's text.", Option_2 = "You get it.", Option_3 =
  "We get it already."), type = "span")

Arguments

sel_id

The id of the selector used to choose options

options

A named list, with the number of options and names of options matching those used in the selector object.

type

Whether the HTML object should be a 'span' object or a 'div' object.

Value

Raw HTML representing the text object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run: 
# RMarkdown code

```{r add_js, results='asis'}
library(selr)
add_javascript()
```

```{r add_selector, results='asis'}
add_selector(
sel_id = "Language",
options = list("Option_1" = "English",
               "Option_2" = "Hebrew",
               "Option_3" = "Pirate")
)
```

```{r, results='asis'}
sel_text(
sel_id = "Language",
options = list("Option_1" = "Hello",
               "Option_2" = "Shalom",
               "Option_3" = "Ahoy")
)
```

## End(Not run)

bschneidr/selr documentation built on May 1, 2021, 10:05 p.m.