Character Version of Sparklines
spk_chr.RdCreate a character version ofinteractive sparklines for use with other 'htmlwidgets' or tags.
Arguments
- values
vectorof values to visualize- ...
additional options passed to
jquery.sparkline; see jquery.sparkline docs- width
height and width of sparkline htmlwidget specified in any valid
CSSsize unit.- height
height and width of sparkline htmlwidget specified in any valid
CSSsize unit.- elementId
stringid as a validCSSelement id.- renderSelector
stringasCSSselector to render in a DOM element other than thehtmlwidgetcontainer
Examples
if (FALSE) { # \dontrun{
#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()
} # }