spk_chr {sparkline} | R Documentation |
Character Version of Sparklines
Description
Create a character version ofinteractive sparklines for use with other 'htmlwidgets' or tags.
Usage
spk_chr(values, ..., width = 60, height = 20, elementId = NULL,
renderSelector = NULL)
Arguments
values |
|
... |
additional options passed to |
width |
height and width of sparkline htmlwidget
specified in any valid |
height |
height and width of sparkline htmlwidget
specified in any valid |
elementId |
|
renderSelector |
|
Examples
## Not run:
#spk_chr works well with dplyr summarise
library(dplyr)
library(sparkline)
library(formattable)
mtcars %>%
group_by(cyl) %>%
summarise(
hp = spk_chr(
hp, type="box",
chartRangeMin=0, chartRangeMax=max(mtcars$hp)
),
mpg = spk_chr(
mpg, type="box",
chartRangeMin=0, chartRangeMax=max(mtcars$mpg)
)
) %>%
formattable() %>%
formattable::as.htmlwidget() %>%
spk_add_deps()
## End(Not run)
[Package sparkline version 2.0 Index]