如何解决R Sparkline Chart 在 Reactable 中的嵌套/扩展行中显示为空
我希望有人能帮我解决这个问题。我是 HTML 新手,这让我很困惑。
library(tidyverse)
library(reactable)
library(sparkline)
myfunct <-
function(Species) {
lapply(1:100,function(x) { runif(1) }) %>% invoke(c,.)
}
df <-
data.frame(Species = rep('setosa',5)) %>%
mutate(data = map(Species,myfunct))
new.iris <-
iris %>%
inner_join(df,by = 'Species') %>%
mutate(rid = row_number())
# underlying sparkline reactable works fine
reactable(new.iris[1:5,5:7],columns = list(
data = colDef(cell = function(values) { sparkline(values) }))
)
# nested it will not display
reactable(new.iris[1:5,c(7,1:5)],details = function(index) {
reactable(new.iris[index,columns = list(
data = colDef(cell = function(values) { sparkline(values)})
))
})
初始图表将显示:
感谢您的帮助。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。