R 和 DT - 可以将行副标题和组添加到数据表吗?
R and DT - Can you add row subheadings and groups to a datatable?
是否可以使用 R
中的 DT
包对行进行分组并向数据表添加子标题?
下面的示例是使用 Javascript (https://datatables.net/examples/advanced_init/row_grouping.html) 中的示例完成的。
从this问题我们可以使用RowGroup
的扩展如下
library(DT)
datatable(iris,
rownames = FALSE,
extensions = 'RowGroup',
options = list(rowGroup = list(dataSrc=c(4)),
columnDefs = list(list(visible=FALSE, targets=c(4)))
)
)
是否可以使用 R
中的 DT
包对行进行分组并向数据表添加子标题?
下面的示例是使用 Javascript (https://datatables.net/examples/advanced_init/row_grouping.html) 中的示例完成的。
从this问题我们可以使用RowGroup
的扩展如下
library(DT)
datatable(iris,
rownames = FALSE,
extensions = 'RowGroup',
options = list(rowGroup = list(dataSrc=c(4)),
columnDefs = list(list(visible=FALSE, targets=c(4)))
)
)