Description Usage Arguments Value Examples
Add an HTML select object
1 2 3 | add_selector(sel_id = "ts_1", options = c(Option_1 = "Option #1",
Option_2 = "Option #2", Option_3 = "Option #3"),
label = "Select an option:")
|
sel_id |
A unique ID for the selector which can be referenced in other places. |
options |
A named character vector. The elements of the character vector are the text visible in the select object. The names serve as option IDs which can be referenced in other places. |
label |
The text to display along with the selector. |
Lines of HTML text which function as a selector.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.