Код: Выделить всё
library(sparkline)
library(formattable)
library(DT)
library(tidyverse)
## Create dataframe
data = data.frame(group = rep(c("A", "B"),3), yr_q = rep(c("2021 Q1", "2021 Q2", "2021 Q3"),2), count = c(1, 2, 3, 4, 5, 6))
## Add in column showing Trend for sparkline
data1 = data %>% group_by(group) %>% summarise("Trend" = spk_chr(count, x = yr_q, tooltipFormat = '{{x}}:{{y}}'))
## Create table (just illustrating issue)
data1 %>% formattable() %>% as.datatable() %>% spk_add_deps()
Подробнее здесь: https://stackoverflow.com/questions/794 ... -sparkline