diff --git a/R/taf.libraries.R b/R/taf.libraries.R new file mode 100644 index 0000000..e421ac7 --- /dev/null +++ b/R/taf.libraries.R @@ -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) +} diff --git a/man/taf.libraries.Rd b/man/taf.libraries.Rd new file mode 100644 index 0000000..3463771 --- /dev/null +++ b/man/taf.libraries.Rd @@ -0,0 +1,35 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/taf.libraries.R +\name{taf.libraries} +\alias{taf.libraries} +\title{TAF Libraries} +\usage{ +taf.libraries(messages = FALSE, warnings = FALSE) +} +\arguments{ +\item{messages}{whether to show messages when package loads.} + +\item{warnings}{whether to show warnings when package loads.} +} +\value{ +TRUE (invisibly) if all packages loaded +} +\description{ +Load and attach all packages from local TAF library. +} +\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. +} +\examples{ +\dontrun{ + +# Load all packages in TAF library +taf.libraries() + +} + +} +\seealso{ +\code{\link{taf.library}} is the TAF function called for each found package. +}