-
Notifications
You must be signed in to change notification settings - Fork 2
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 #15 from iagomosqueira/master
Suggested taf.libraries()
- Loading branch information
Showing
2 changed files
with
79 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#' TAF Libraries | ||
#' | ||
#' Load and attach all packages from local TAF library. | ||
#' | ||
#' @param messages whether to show messages when package loads. | ||
#' @param warnings whether to show warnings when package loads. | ||
#' | ||
#' @return TRUE (invisibly) if all packages loaded | ||
#' | ||
#' @note | ||
#' Packages in the TAF library are loaded in the order in which they are | ||
#' listed in SOFTWARE.bib. Internal dependencies can in this way be respected. | ||
#' | ||
#' @seealso | ||
#' \code{\link{taf.library}} is the TAF function called for each found package. | ||
#' | ||
#' @examples | ||
#' \dontrun{ | ||
#' | ||
#' # Load all packages in TAF library | ||
#' taf.libraries() | ||
#' | ||
#' } | ||
#' | ||
#' @export | ||
|
||
taf.libraries <- function(messages=FALSE, warnings=FALSE) { | ||
|
||
bib <- TAF:::read.bib(file.path(boot.dir(), "SOFTWARE.bib")) | ||
|
||
entries <- names(bib) | ||
|
||
installed <- taf.library() | ||
|
||
pkgs <- entries[entries %in% installed] | ||
|
||
res <- lapply(pkgs, function(x) { | ||
if(dir.exists(file.path(boot.dir(), "library", x))) | ||
do.call("taf.library", list(package=x, messages=messages, | ||
warnings=warnings)) | ||
}) | ||
|
||
invisible(TRUE) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.