我正在尝试使用该gt
包创建一个表。现在,当我尝试将 a 添加spanner
到表中时,代码会返回错误。
gt_tbl =
gt(data = merged.dfs) %>%
tab_header(
title = "Two sample K-S Test Statistics for 2004") %>%
tab_spanner(
label = "Pair 1 (VIC SC and PCA SC)",
columns = c(D.Max.04.p1, p.value.04.p1)
) %>%
tab_spanner(
label = "Pair 2 (VIC SCB1 and PCA SCB1)",
columns = c(D.Max.04.p2, p.value.04.p2)
)
错误
Error: Can't subset columns that don't exist.
x Column `0.19` doesn't exist.
请注意,当我运行以下代码时,会创建表,并且可以看到列确实存在。如何修复此错误?
gt_tbl =
gt(data = merged.dfs) %>%
tab_header(
title = "Two sample K-S Test Statistics for 2004")