sel_image: Create a dynamic image object

Description Usage Arguments Value Examples

View source: R/sel_image.R

Description

Create a dynamic image object

Usage

1
2
3
sel_image(sel_id = "ts_1", options = c(Option_1 = "Images/Iris.png",
  Option_2 = "Images/mtcars.png", Option_3 = "Images/US Arrests.png"),
  embed = TRUE)

Arguments

sel_id

The id of the selector used to choose options

options

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

embed

A logical vector for whether images should be embedded directly into the HTML code as base64 strings. If FALSE, image files are referred to via links in the HTML code.

Value

Raw HTML representing the image 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
## Not run:  
```{r add_js, results='asis'}
library(selr)
add_javascript()
```

```{r add_selector, results='asis'}
add_selector(
sel_id = "Dataset",
options = list("Option_1" = "iris",
               "Option_2" = "mtcars",
               "Option_3" = "US Arrests")
)
```

```{r, results='asis'}
sel_text(
sel_id = "Dataset",
options = list("Option_1" = "Plots/Iris.png",
               "Option_2" = "Plots/mtcars.png",
               "Option_3" = "Plots/US Arrests.png")
)
```

## End(Not run)

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