-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from nutterb/new-latex-tables
Upgrade to 0.7.0
- Loading branch information
Showing
64 changed files
with
3,950 additions
and
1,569 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
^README-.*\.png$ | ||
^xtable_vs_pixiedust.html$ | ||
^xtable_vs_pixiedust.Rmd$ | ||
^\inst\save_sprinkles_rda.R$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,36 @@ | ||
Package: pixiedust | ||
Date: 2016-01-08 | ||
Title: Tables so Beautifully Fine-Tuned You Will Believe It's Magic | ||
Version: 0.6.1 | ||
Version: 0.7.0 | ||
Authors@R: person("Benjamin", "Nutter", email = "nutter@battelle.org", role = c("aut", "cre")) | ||
Description: The introduction of the broom package has made converting model objects into data | ||
frames as simple as a single function. While the broom package focuses on providing tidy | ||
data frames that can be used in advanced analysis, it deliberately stops short of providing | ||
functionality for reporting models in publication-ready tables. pixiedust provides this | ||
functionality with a programming interface intended to be similar to ggplot2's system of | ||
layers with fine tuned control over each cell of the table. Options for output include | ||
printing to the console and to the common markdown formats (markdown, HTML, and LaTeX). | ||
With a little pixiedust (and happy thoughts) tables can really fly. | ||
Depends: R (>= 3.2.1) | ||
Imports: | ||
ArgumentCheck, | ||
broom, | ||
dplyr, | ||
Hmisc (>= 3.14-6), | ||
htmltools, | ||
knitr, | ||
lazyWeave, | ||
magrittr, | ||
stringr, | ||
tidyr | ||
Description: The introduction of the broom package has made converting model | ||
objects into data frames as simple as a single function. While the broom | ||
package focuses on providing tidy data frames that can be used in advanced | ||
analysis, it deliberately stops short of providing functionality for reporting | ||
models in publication-ready tables. pixiedust provides this functionality with | ||
a programming interface intended to be similar to ggplot2's system of layers | ||
with fine tuned control over each cell of the table. Options for output include | ||
printing to the console and to the common markdown formats (markdown, HTML, and | ||
LaTeX). With a little pixiedust (and happy thoughts) tables can really fly. | ||
Depends: | ||
R (>= 3.2.1) | ||
Imports: | ||
ArgumentCheck, | ||
broom, | ||
checkmate, | ||
dplyr, | ||
Hmisc (>= 3.14-6), | ||
htmltools, | ||
knitr, | ||
lazyWeave, | ||
magrittr, | ||
stringr, | ||
tidyr | ||
Suggests: | ||
rmarkdown, | ||
testthat | ||
rmarkdown, | ||
testthat | ||
License: MIT + file LICENSE | ||
LazyData: true | ||
VignetteBuilder: knitr | ||
URL: https://github.com/nutterb/pixiedust | ||
BugReports: https://github.com/nutterb/pixiedust/issues | ||
RoxygenNote: 5.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#' @name assert_match_arg | ||
#' @title Checkmate Compatible Version of \code{match.arg} | ||
#' | ||
#' @description Matches arguments as \code{match.arg} and returns | ||
#' the value of the selected argument. | ||
#' | ||
#' @param x A character vecotr (of length one unless \code{several.ok} is \code{TRUE} | ||
#' or \code{NULL}. | ||
#' @param choices A character vector of candidate values | ||
#' @param several_ok logical specifying if \code{arg} should be allowed to have more | ||
#' than one element. | ||
#' @param .var.name \code{character(1)}, name of the checked object to print in | ||
#' assertions. Defaults to the heuristic implemented in | ||
#' \code{\link[checkmate]{vname}} | ||
#' @param add \code{AssertCollection}, Colleciton to store assertion messages. | ||
#' See \code{link[checkmate]{AssertCollection}}. | ||
#' @param ... Additional arguments to pass to either | ||
#' \code{\link[checkmate]{assertChoice}} or \code{\link[checkmate]{assertSubset}}. | ||
#' \code{assertChoice} is used when \code{several_ok = FALSE}, otherwise | ||
#' \code{assertSubset} is used. | ||
#' | ||
#' @seealso \code{\link{match.arg}}, \code{\link[checkmate]{assertChoice}}, | ||
#' \code{\link[checkmate]{assertSubset}} | ||
|
||
assert_match_arg <- function(x, choices, several_ok = FALSE, | ||
.var.name = checkmate::vname(x), add = NULL) | ||
{ | ||
if (identical(x, choices)) | ||
if (several_ok) return(x) else return(x[1]) | ||
|
||
if (!several_ok) | ||
{ | ||
if (!checkmate::checkCharacter(x, len = 1)) | ||
{ | ||
add$push(sprintf("Assertions on '%s' failed: must have length 1, but has length %s", | ||
.var.name, length(x))) | ||
#* If an AssertCollection is used, we want to mimic a failure | ||
#* to find a match. | ||
return(character(0)) | ||
} | ||
} | ||
|
||
x <- choices[pmatch(x, choices, nomatch = 0L, duplicates.ok = several_ok)] | ||
if (several_ok) checkmate::assertSubset(x, choices, empty.ok = FALSE, | ||
.var.name = .var.name, add = add) | ||
else checkmate::assertChoice(x, choices, | ||
.var.name = .var.name, add = add) | ||
#* If a match(es) is found, return it. If no match is found | ||
#* and an AssertCollection is used, return character(0) | ||
x | ||
} |
Oops, something went wrong.