inst/examples/examples_dplyr.R

\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()
}

Try the sparkline package in your browser

Any scripts or data that you put into this service are public.

sparkline documentation built on May 2, 2019, 11:02 a.m.