nutterb / pixiedust

Tables So Beautifully Fine-Tuned You Will Believe It's Magic.
179 stars 18 forks source link

glance_foot can't build when col_pairs is a divisor of total_cols #26

Closed nutterb closed 8 years ago

nutterb commented 8 years ago

In the example below, there are no filler columns between the col_pairs, and this is generating an error. Please fix!

fit <- lm(mpg ~ qsec + factor(am) + wt * factor(gear), data = mtcars)

library(pixiedust)
dust(fit,
     descriptors = c("label", "level_detail"),
     glance_foot = TRUE, col_pairs = 2) %>%
  sprinkle(cols = 3:5, round = 2) %>%
  sprinkle(cols = 6, fn = quote(pvalString(value))) %>%
  sprinkle(cols = c(2, 6), round = 2, na_string = "", part = "foot") %>%
  sprinkle(rows = 1, border = "top") %>%
  sprinkle(rows = 1, border = "top", border_color = "gray", 
           border_style = "dashed", part = "foot") %>%
  sprinkle(rows = 6, border = "bottom", part = "foot") %>%
  sprinkle_print_method("html")