R/p_path.R

Defines functions p_path

Documented in p_path

#' Path to Library of Add-On Packages
#' 
#' Path to library of add-on packages.
#' 
#' @param package Name of package (default returns path to library of add-on 
#' packages).
#' @seealso \code{\link[base]{.libPaths}}
#' @keywords package library location path
#' @export
#' @examples
#' p_path()
#' p_path(pacman)
p_path <-
function(package="R"){

    ## check if package is an object
    if(!object_check(package) || !is.character(package)){
        package <- as.character(substitute(package))
    }
    
    if (package == "R"){
        return(.libPaths())
    } else {
        return(find.package(package))
    }
        
}

Try the pacman package in your browser

Any scripts or data that you put into this service are public.

pacman documentation built on May 2, 2019, 1:08 p.m.