nutterb / pixiedust

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

Some stuff I need to tweak #48

Closed nutterb closed 8 years ago

nutterb commented 8 years ago

From having switched to checkmate

  1. How do I want to handle partial matching or arguments? I have it documented that halign does partial matching and will fail if multiple values are specified. Having used assertSubset, I don't get that same behavior quite so easily.
  2. I need a way to center, left align, or right align the entire table in HTML and LaTeX

    For bookdown support

  3. Method to auto detect print method
  4. table labels should reference chunk name, not pixie count
nutterb commented 8 years ago

I submitted this function to the checkmate repository. It may or not be accepted there. I should include it in pixiedust for now. It at least gives me something to work with until something comes along that supports the AssertCollection object.

assert_match_arg <- function(x, choices, several_ok = FALSE, ...)
{
  x <- choices[pmatch(x, choices, nomatch = 0L, duplicates.ok = several_ok)]
  if (several_ok) assertSubset(x, choices, ...)
  else assertChoice(x, choices, ...)
  x
}
nutterb commented 8 years ago

Implemented in 0.6.4