![]() ![]() ![]() p_temp(aprof)Ĭontent type 'application/zip' length 34037 bytes (33 Kb) This allows a session-only install for testing out a single package without muddying the user's library. Lastly, p_temp enables the user to temporarily install a package. This may be helpful in blog posts where a new function is being demonstrated, requiring a particular version of a package. If the package does not exist or the minimum version is not met, p_install attempts to install the package from CRAN. The p_install_version ensures that a package is at least some version cut off. The user may need a minimal version of a particular package installed. Note: Packages are passed as character vector repository addresses in the form of "trinker/regexr", "trinker/regexr", a Minimal Package Version p_load_gh and p_install_gh are wrapper functions that are named and operate similarly to pacman's p_load and p_install. Pacman provides a wrapper to the devtools package's install_github function for installing and loading GitHub packages. For example: p_install(dbConnect, qdap, reports) The p_install (aliased as p_get) will allow the user to install with the same ease of format as p_load. The user may wish to only install packages. ![]() With pacman this call can be reduced to: pacman::p_load(XML, devtools, RCurl, fakePackage, SPSSemulate) Sapply(names(success), require, character.only = TRUE) Success <- suppressWarnings(sapply(packs, require, character.only = TRUE)) For example, many blog posts begin coding with this sort of package call: packs <- c("XML", "devtools", "RCurl", "fakePackage", "SPSSemulate") argument allows the user to pass in quoted (or unquoted) package names. The form for the function is: p_load(., char, install = TRUE, update = getOption("pac_update"), character.only = FALSE) P_load is a general use tool that can install, load, and update packages. The functions in this section act on packages. The heart of pacman is it's ability to reduce typing in package management actions. Installing, Loading, Unloading, Updating, & Deleting In keeping with the library function, the user need not use quotes around package names for most * pacman functions. For instance the p_load function allows the user to load one or more packages as a more generic substitute for the library or require functions and if the package isn't available locally it will install it for you. The function p_load is particularly well suited for help forums and blog posts, as it will load and, if necessary, install missing packages.įunction names in the pacman package follow the format of p_xxx where 'xxx' is the task the function performs. Rprofile to increase workflow by reducing time recalling obscurely named functions, reducing code, and integrating functionality of base functions to simultaneously perform multiple actions. The pacman package is an R package management tool that combines the functionality of base library related functions into intuitively named functions. Introduction to pacman Introduction to pacman Tyler W. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |