nutterb / pixiedust

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

Sprinkles desperately need recycling. #42

Closed nutterb closed 8 years ago

nutterb commented 8 years ago

Now that I've got the mechanics worked out, it would be really handy to be able to give more than one value to a sprinkle.

For instance, if I want to set the width of three columns, it would be nice to write

sprinkle(x, cols = 1:3, width = c(.5, 1.5, 1), recycle = "cols")

instead of

sprinkle(x, cols = 1, width = .5) %>%
sprinkle(x, cols = 2, width = 1.5) %>%
sprinkle(x, cols = 3, width = 1)

By adding another argument to sprinkle where recycle = c("colums", "rows"), values could be recycled by row or by column. This would work essentially the same as bg_pattern_by. I might leave bg_pattern_by as a sprinkle that takes the value of recycle except when directly specified otherwise.