Dear list,

I'm most likely doing something wrong, but I'm getting an error message in
tab2 below (tab1 is fine). Any hint is much appreciated.

library(tables)
set.seed(1)
dd <- data.frame(x = rnorm(100), f1 = gl(2, 50, labels = c("A", "B")),
                 f2 = gl(4, 25, labels = c("a", "b", "c", "d")),
                 f3 = as.factor(sample(1:10, 100, replace = T)))


tab1 <- tabular((n=1) + Format(digits=1) * ((x) * (Avg. = mean)) +
                 Format(digits=4) * ((Factor(f1) + Factor(f2)) * (Pctn. =
Percent('col'))) ~
                 Justify(c) * (f3 + 1), data = dd)
tab1

tab2 <- tabular((n=1) + Format(digits=1) * ((x) * (Avg. = mean)) +
                  Format(digits=4) * ((Factor(f1)) * (Pctn. =
Percent('col'))) ~
                  Justify(c) * (f3 + 1), data = dd)
Error in justification[j, ] <- rightjustification :
  number of items to replace is not a multiple of replacement length

Best,
Lars.

	[[alternative HTML version deleted]]

