dmurdoch / tables

Formula-Driven Table Generation
https://dmurdoch.github.io/tables/
13 stars 2 forks source link

Multicolumn `PlusMinus()` and `Paste()` formatted badly #13

Closed dmurdoch closed 1 year ago

dmurdoch commented 1 year ago

This was reported by Reinhard Kerschner: This table gives too many spaces ahead of some of the standard errors:

stderr <- function(x) sd(x)/sqrt(length(x))
set.seed(123)
testdata <- data.frame(x = rt(150, 1) + 1000, group=factor(rep(c("a", "b", "c"), each=50)), row = factor(rep(rep(1:5, 3), 10) ))

library(tables)

toLatex(tabular(row ~ Heading("Group")*x*Heading()*group*PlusMinus (mean, stderr, digits=2), data = testdata))
dmurdoch commented 1 year ago

Fixed by https://github.com/dmurdoch/tables/commit/3fbe4fa3746877f2d602577ff8279026812cc72c