-
Notifications
You must be signed in to change notification settings - Fork 5
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 #95 from jfisher-usgs/master
Merge with upstream
- Loading branch information
Showing
19 changed files
with
232 additions
and
137 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: inlmisc | ||
Title: Miscellaneous Functions for the USGS INL Project Office | ||
Version: 0.4.3.9000 | ||
Version: 0.4.4 | ||
Authors@R: person(given=c("Jason", "C."), family="Fisher", role=c("aut", "cre"), email="[email protected]", comment=c(ORCID="0000-0001-9032-8912")) | ||
Description: A collection of functions for creating high-level graphics, | ||
performing raster-based analysis, processing MODFLOW-based models, | ||
|
@@ -12,7 +12,7 @@ Depends: | |
R (>= 3.4.0) | ||
Imports: | ||
checkmate, | ||
dplyr, | ||
data.table, | ||
GA, | ||
graphics, | ||
grDevices, | ||
|
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,53 @@ | ||
#' Build Package Vignettes | ||
#' | ||
#' Build package vignettes from their sources and place in the \code{/inst/doc} folder. | ||
#' | ||
#' @param pkg 'character' string. | ||
#' Package path, by default the \link[=getwd]{working directory}. | ||
#' @param quiet 'logical' flag. | ||
#' Whether to supress most output. | ||
#' @param clean 'logical' flag. | ||
#' Whether to remove all intermediate files generated by the build. | ||
#' @param gs_quality 'character' string. | ||
#' Quality of compacted PDF files, | ||
#' see \code{\link[tools]{compactPDF}} function for details. | ||
#' | ||
#' @author J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center | ||
#' | ||
#' @seealso \code{\link[tools]{buildVignettes}} | ||
#' | ||
#' @keywords utilities | ||
#' | ||
#' @export | ||
#' | ||
#' @examples | ||
#' \dontrun{ | ||
#' BuildVignettes("<path/to/package>", gs_quality = "ebook") | ||
#' } | ||
#' | ||
|
||
BuildVignettes <- function(pkg=".", quiet=TRUE, clean=TRUE, gs_quality=NULL) { | ||
|
||
checkmate::assertFileExists(file.path(pkg, "DESCRIPTION")) | ||
checkmate::assertFlag(quiet) | ||
checkmate::assertFlag(clean) | ||
if (!is.null(gs_quality)) | ||
gs_quality <- match.arg(gs_quality, c("none", "printer", "ebook", "screen")) | ||
|
||
tools::buildVignettes(dir=pkg, quiet=quiet, clean=clean, tangle=TRUE) | ||
|
||
v <- tools::pkgVignettes(dir=pkg, output=TRUE, source=TRUE) | ||
if (length(v) == 0) return(invisible(NULL)) | ||
out <- c(v$outputs, unique(unlist(v$sources, use.names=FALSE))) | ||
|
||
doc <- file.path(pkg, "inst/doc") | ||
|
||
dir.create(doc, showWarnings=!quiet, recursive=TRUE) | ||
file.copy(c(v$docs, out), doc, overwrite=TRUE) | ||
file.remove(out) | ||
|
||
if (!is.null(gs_quality)) | ||
tools::compactPDF(paths=doc, gs_quality=gs_quality) | ||
|
||
invisible(TRUE) | ||
} |
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
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
Oops, something went wrong.