From b6efceff313fec6fa21f465f9a70abe1eee9200b Mon Sep 17 00:00:00 2001 From: eliotmcintire Date: Sat, 27 Jul 2024 20:27:46 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Predicti?= =?UTF-8?q?veEcology/Require@942f5cc64b8e65b69db3655172cf33acda9c9c9a=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- news/index.html | 2 +- pkgdown.yml | 2 +- reference/checkPath.html | 2 +- reference/normPath.html | 2 +- search.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/news/index.html b/news/index.html index 3c789c7e..fb3d5831 100644 --- a/news/index.html +++ b/news/index.html @@ -34,7 +34,7 @@

Changelog

-

version 1.0.0

+

version 1.0.0

CRAN release: 2024-07-27

major changes

  • Installation, package downloading, and package building from source now occur in an external process using sys package. This allows for more control over messaging during installations, and it also allows of installation of many packages that are already loaded (with a message that the session will need restarting). This can be turned off with This is turned on with option(Require.installPackagesSys = FALSE).
  • diff --git a/pkgdown.yml b/pkgdown.yml index 48446373..51705403 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -3,7 +3,7 @@ pkgdown: 2.1.0 pkgdown_sha: ~ articles: Require: Require.html -last_built: 2024-07-27T01:08Z +last_built: 2024-07-27T20:27Z urls: reference: https://Require.predictiveecology.org/reference article: https://Require.predictiveecology.org/articles diff --git a/reference/checkPath.html b/reference/checkPath.html index 4e75ec33..68976e14 100644 --- a/reference/checkPath.html +++ b/reference/checkPath.html @@ -110,7 +110,7 @@

    Examples#> [1] FALSE checkPath(tmpdir, create = TRUE) -#> [1] "/tmp/RtmpbnaRVg/example_checkPath" +#> [1] "/tmp/RtmpimO25S/example_checkPath" dir.exists(tmpdir) ## TRUE #> [1] TRUE diff --git a/reference/normPath.html b/reference/normPath.html index 888a6db0..49e639ee 100644 --- a/reference/normPath.html +++ b/reference/normPath.html @@ -107,7 +107,7 @@

    Examples#> [1] FALSE checkPath(tmpdir, create = TRUE) -#> [1] "/tmp/RtmpbnaRVg/example_checkPath" +#> [1] "/tmp/RtmpimO25S/example_checkPath" dir.exists(tmpdir) ## TRUE #> [1] TRUE diff --git a/search.json b/search.json index 8df3aaf0..630e3bed 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://Require.predictiveecology.org/CONTRIBUTING.html","id":"report-a-bug","dir":"","previous_headings":"","what":"Report a bug","title":"NA","text":"Use issue tracker report bug. Please include minimum reproducible example triggers bug. Please include output devtools::session_info().","code":""},{"path":"https://Require.predictiveecology.org/CONTRIBUTING.html","id":"submit-an-enhancement","dir":"","previous_headings":"","what":"Submit an enhancement","title":"NA","text":"Git repository uses Git Flow branching model (git flow extension useful ). development branch contains latest contributions code appear next release, master branch contains code latest release, exactly currently CRAN. make contribution package, just send pull request. send PR, make sure development destination branch Require repository. PR pass R CMD check ---cran, also checked GitHub Actions PR submitted. ’ll try review pull request provide feedback / merge improvements quickly possible. Thank !","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"principles-used-in-require","dir":"Articles","previous_headings":"","what":"Principles used in Require","title":"The `Require` approach, comparing `pak` and `renv`","text":"Require designed features facilitate running R code part continuous reproducible workflow, data--decisions. work, functions called user property whereby initial time called heavy work, subsequent times sufficiently fast user forced skip lines code re-running code. called “rerun-tolerance”, .e., line can rerun identical conditions quickly return original result. package, reproducible, function Cache can convert many function calls property. work well functions whose objectives side-effects, like installing loading packages. Require fills gap.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"key-features","dir":"Articles","previous_headings":"Principles used in Require","what":"Key features","title":"The `Require` approach, comparing `pak` and `renv`","text":"Features include: Fast, parallel installs downloads. Installs CRAN CRAN-alike even archived.. Installs GitHub packages. User can specify version install using standard R-version approach (e.g., ==3.5.0 >=3.5.0). Local package caching cloning (see ) fast (re-)installs. Manages (types ) conflicting package requests, .e., different GitHub branches. options-level control packages installed source (see RequireOptions()) even downloaded binary repository. Finds specific versions packages incomplete CRAN-like repository (r-universe.dev), even version available, available main CRAN mirrors. Handles errors handled install.packages like “already use”.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"how-it-works","dir":"Articles","previous_headings":"Principles used in Require","what":"How it works","title":"The `Require` approach, comparing `pak` and `renv`","text":"Require uses install.packages internally install packages. However, let install.packages download packages. Rather, identifies dependencies recursively, finds (CRAN, GitHub, Archives, Local), downloads (gets local cache clones specified package library). libcurl available (assessed via capabilities(\"libcurl\")), download parallel CRAN-like repositories. sys installed, download GitHub packages parallel also. user set options(\"Ncpus\") manually, set value 8 parallel installs binary source packages.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"rerun-tolerance","dir":"Articles","previous_headings":"Principles used in Require","what":"Rerun-tolerance","title":"The `Require` approach, comparing `pak` and `renv`","text":"functionally reproducible, code must regularly run tested many operating systems computers. happen, user/developer know certain code chunks longer work try run later. words, code gets stale underlying algorithms data change. rerun-tolerant, function must: return result outcome every time run (first, second times later); fast first time; fast, users skip running “don’t need run slow” Require . See “fast”.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"why-these-features-help-teams","dir":"Articles","previous_headings":"Principles used in Require","what":"Why these features help teams","title":"The `Require` approach, comparing `pak` and `renv`","text":"common code development work teams, updating package code. beneficial whether team tight, working exactly project, looser share certain components across diverse projects.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"all-working-on-same-project","dir":"Articles","previous_headings":"Principles used in Require > Why these features help teams","what":"All working on same project","title":"The `Require` approach, comparing `pak` and `renv`","text":"whole team working “whole” project, may useful use “package snapshot” approach, used renv package. Require offers similar functionality function pkgSnapshot(). Using approach provides mechanism team member update code, snapshot project, commit snapshot push cloud team share.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"diverse-projects","dir":"Articles","previous_headings":"Principles used in Require > Why these features help teams","what":"Diverse projects","title":"The `Require` approach, comparing `pak` and `renv`","text":"However, team diversified actually sharing new code, whole project, project snapshots inefficient package management must package--package case, whole project. words, code developer can work package, various team members 2 options might want : keep bleeding edge update necessary dependencies. likely, want mixture strategies, .e., bleeding edge code, necessary others. Thus, Require offers programmatic control . example keep project bleeding edge development branch reproducible, update necessary (based version needed, expressed inequality) development branch SpaDES.core. user make decisions run time whether update made, packages.","code":"library(Require) Require::Install( c(\"PredictiveEcology/reproducible@development (HEAD)\", \"PredictiveEcology/SpaDES.core@development (>=2.0.5.9004)\"))"},{"path":[]},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"default-behaviours-different","dir":"Articles","previous_headings":"How Require differs from other approaches","what":"Default behaviours different","title":"The `Require` approach, comparing `pak` and `renv`","text":"packages yet installed: packages installed: packages already installed, latest CRAN:","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"differences-and-similarities-between-pak-and-require","dir":"Articles","previous_headings":"How Require differs from other approaches","what":"Differences and similarities between pak and Require","title":"The `Require` approach, comparing `pak` and `renv`","text":"table based Require v1.0.0 pak v0.7.2. * Indicates example .","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"archived-packages","dir":"Articles","previous_headings":"How Require differs from other approaches","what":"Archived packages","title":"The `Require` approach, comparing `pak` and `renv`","text":"mid March 2024 April 5, 2024, fastdigest taken CRAN. part direct dependencies, can remove find alternative. However, indirect dependency, don’t choice: workflow break. Require just get recent archived copy work can continue. fastdigest back CRAN, others , e.g., older knn package:","code":"Require::Install(\"knn\") try(pak::pkg_install(c(\"knn\")))"},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"dependency-conflict","dir":"Articles","previous_headings":"How Require differs from other approaches","what":"Dependency conflict","title":"The `Require` approach, comparing `pak` and `renv`","text":"code development, common use many GitHub packages. (dependencies) may point one branches, either directly user Remotes field. next example, pak errors, Require makes decisions installs. common occurrence teams developing packages concurrently. pak approach suggests prepending :: package(s) /causing conflict. may suffice situations. Require approach assume equivalent :: means prioritize base (order) 1. use package version requirements, 2. CRAN-like repositories, 3. order. following work pak BioSIM, dependency GitHub found. may package name repository name, clear error message :","code":"library(Require) # Fails because of a) packages taken off CRAN & multiple GitHub branches requested within the nested dependencies pkgs <- c(\"reproducible\", \"PredictiveEcology/SpaDES@development\") dirTmp <- tempdir2(sub = \"first\") .libPaths(dirTmp) install.packages(\"pak\") # need this in the library; can't use personal library version try(pak::pkg_install(pkgs)) # ✔ Loading metadata database ... done # Error : ! error in pak subprocess # Caused by error: # ! Could not solve package dependencies: # * reproducible: dependency conflict # * PredictiveEcology/SpaDES@development: Can't install dependency PredictiveEcology/reproducible@development (>= 2.0.10) # * PredictiveEcology/reproducible@development: Conflicts with reproducible pkgsAny <- c(\"any::reproducible\", \"PredictiveEcology/SpaDES@development\") try(pak::pkg_install(pkgsAny)) # Fine dirTmp <- tempdir2(sub = \"second\") .libPaths(dirTmp) Require::Install(pkgs) # Fails try(pk <- pak::pak(c(\"PredictiveEcology/LandR@development\", \"PredictiveEcology/LandR@main\"))) # Error : ! error in pak subprocess # Caused by error: # ! Could not solve package dependencies: # * PredictiveEcology/LandR@development: Conflicts with PredictiveEcology/LandR@main # * PredictiveEcology/LandR@main: Conflicts with PredictiveEcology/LandR@development # Fine -- takes in order, so main first in this example rq <- Require::Install(c(\"PredictiveEcology/LandR@main\", \"PredictiveEcology/LandR@development\")) # Fine -- takes by version requirement, so takes development, # which is the only one that fulfills requirement on Jul 25, 2024 rq <- Require::Install(c(\"PredictiveEcology/LandR@main\", \"PredictiveEcology/LandR@development (>=1.1.5)\")) try(gg <- pak::pkg_deps(\"PredictiveEcology/LandR@development\", dependencies = TRUE)) ff <- Require::pkgDep(\"PredictiveEcology/LandR@development\", dependencies = TRUE)"},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"version-requirements-determine-package-installation","dir":"Articles","previous_headings":"How Require differs from other approaches","what":"Version requirements determine package installation","title":"The `Require` approach, comparing `pak` and `renv`","text":"Version number requirements drive package updates. user need update version numbers sufficient, update occur. version number specification, installs occur package present. Multiple simultaneous requests install package appear incompatible sources, create conflict unless version requirements cause conflict. version number requirements specified, CRAN versions take precedence, sequence packages listed installation take preference otherwise. Require can handle package version specifications function call (pak can handle DESCRIPTION file, >=), whereas pak (currently).","code":"# The following has no version specifications, # so CRAN version will be installed or none installed if already installed Require::Install(c(\"PredictiveEcology/reproducible@development\", \"reproducible\")) # The following specifies \"HEAD\" after the Github package name. This means the # tip of the development branch of reproducible will be installed if not already installed Require::Install(c(\"PredictiveEcology/reproducible@development (HEAD)\", \"reproducible\")) # The following specifies \"HEAD\" after the package name. This means the # tip of the development branch of reproducible Require::Install(c(\"PredictiveEcology/reproducible@development\", \"reproducible (HEAD)\")) # Not a problem because version number specifies Require::Install(c(\"PredictiveEcology/reproducible@modsForLargeArchives (>=2.0.10.9010)\", \"PredictiveEcology/reproducible (>= 2.0.10)\")) # Even if branch does not exist, if later version requirement specifies a different branch, no error Require::Install(c(\"PredictiveEcology/reproducible@modsForLargeArchives (>=2.0.10.9010)\", \"PredictiveEcology/reproducible@validityTest (>= 2.0.9)\")) ## FAILS - can't specify version requirements try(pak::pkg_install( c(\"PredictiveEcology/reproducible@modsForLargeArchives (>=2.0.10.9010)\", \"PredictiveEcology/reproducible (>= 2.0.10)\")))"},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"why-is-it-fast","dir":"Articles","previous_headings":"How Require differs from other approaches","what":"Why is it fast?","title":"The `Require` approach, comparing `pak` and `renv`","text":"features make fast first time used system, make fast second & subsequent time system (can first time new project). features caching, cloning, parallel downloads.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"caching","dir":"Articles","previous_headings":"How Require differs from other approaches > Why is it fast?","what":"Caching","title":"The `Require` approach, comparing `pak` and `renv`","text":"Require creates local cache several steps: packages files (source binary including locally built binaries); package dependency tree (RAM currently, affects session); available package matrices CRAN-like repositories. Together, speed installation packages computer can access local cache, e.g., new project. Require keeps binary source package built, can therefore install binary subsequent installation. results dramatically faster installations source packages built locally.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"cloning-still-experimental-do-not-default","dir":"Articles","previous_headings":"How Require differs from other approaches > Why is it fast?","what":"Cloning (still experimental; do not default)","title":"The `Require` approach, comparing `pak` and `renv`","text":"Require option, options(\"Require.cloneFrom\"), , set, create hard link current project’s package library library pointed option. Setting e.g. options(\"Require.cloneFrom\" = Sys.getenv(\"R_LIBS_USER\")) allow packages user’s personal library source “copying” project library. dramatically faster installing, even installation local binary local cache.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"binary-on-linux","dir":"Articles","previous_headings":"How Require differs from other approaches","what":"Binary on Linux","title":"The `Require` approach, comparing `pak` and `renv`","text":"Linux, users ability install binary packages pre-built e.g., Posit Package Manager. Sometimes binary incompatible user’s system, even though correct operating system. occurs generally several packages, thus must installed source. Require function sourcePkgs(), can informed options(\"Require.spatialPkgs\") options(\"Require.otherPkgs\") can set user package--package basis. default, automatically installed \"source\" experience, tend fail installed binary.","code":"# In this example, it is `terra` that must be installed from source on Linux if (Require:::isLinux()) { Require::setLinuxBinaryRepo() pkgs <- c(\"terra\", \"PSPclean\") pkgFullName <- \"ianmseddy/PSPclean@development\" try(remove.packages(pkgs)) pak::cache_delete() # make sure a locally built one is not present in the cache try(pak::pkg_install(pkgFullName)) # ✔ Loading metadata database ... done # # → Will install 2 packages. # → Will download 2 packages with unknown size. # + PSPclean 0.1.4.9005 [bld][cmp][dl] (GitHub: fed9253) # + terra 1.7-71 [dl] + ✔ libgdal-dev, ✔ gdal-bin, ✔ libgeos-dev, ✔ libproj-dev, ✔ libsqlite3-dev # ✔ All system requirements are already installed. # # ℹ Getting 2 pkgs with unknown sizes # ✔ Got PSPclean 0.1.4.9005 (source) (43.29 kB) # ✔ Got terra 1.7-71 (x86_64-pc-linux-gnu-ubuntu-22.04) (4.24 MB) # ✔ Downloaded 2 packages (4.28 MB) in 2.9s # ✔ Installed terra 1.7-71 (61ms) # ℹ Packaging PSPclean 0.1.4.9005 # ✔ Packaged PSPclean 0.1.4.9005 (420ms) # ℹ Building PSPclean 0.1.4.9005 # ✖ Failed to build PSPclean 0.1.4.9005 (3.7s) # Error: # ! error in pak subprocess # Caused by error in `stop_task_build(state, worker)`: # ! Failed to build source package PSPclean. # Type .Last.error to see the more details. # Works fine because the `sourcePkgs()` try(remove.packages(pkgs)) # uninstall to make sure it is a clean install for this test Require::cacheClearPackages(pkgs, ask = FALSE) # remove any existing local packages Require::Install(pkgFullName) }"},{"path":[]},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"default-arguments-pkgdep----which-xx-includes-linkingto","dir":"Articles","previous_headings":"How Require differs from other approaches > Package dependencies","what":"default arguments – pkgDep(..., which = XX) includes LinkingTo","title":"The `Require` approach, comparing `pak` and `renv`","text":"pkgDep, default, includes LinkingTo required Rcpp required, strictly necessary. pak::pkg_deps include LinkingTo default.","code":"depPak <- pak::pkg_deps(\"PredictiveEcology/LandR@LandWeb\") depRequire <- Require::pkgDep(\"PredictiveEcology/LandR@LandWeb\") # Slightly different default in Require # Same pakDepsClean <- setdiff(Require::extractPkgName(depPak$ref), Require:::.basePkgs) requireDepsClean <- setdiff(Require::extractPkgName(depRequire[[1]]), Require:::.basePkgs) setdiff(pakDepsClean, requireDepsClean) setdiff(requireDepsClean, pakDepsClean) # does not report \"RcppArmadillo\", \"RcppEigen\", \"cpp11\" which are LinkingTo"},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"cran-preference","dir":"Articles","previous_headings":"How Require differs from other approaches","what":"CRAN-preference","title":"The `Require` approach, comparing `pak` and `renv`","text":"version specification, Require prefers CRAN packages multiple pointers package. Thus, even though package may Remotes field pointing e.g., PredictiveEcology/SpaDES.tools@development, recursive dependency within package specifies SpaDES.tools without Remotes field, pkgDep return CRAN version. user wants override behaviour, user can specify version requirement can satisfied Remotes option. pkgDep take . pak::pkg_deps prefers top-level specification, .e., non-recursive Remotes field returned, even package also specified within recursive dependency without Remotes field, .e, recursive dependency points CRAN package, return version dependency.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"pak-fails-for-packages-on-github-that-are-not-same-name-as-git-repo-in-remotes","dir":"Articles","previous_headings":"How Require differs from other approaches > CRAN-preference","what":"pak fails for packages on GitHub that are not same name as Git Repo in Remotes","title":"The `Require` approach, comparing `pak` and `renv`","text":"","code":"gg <- pak::pkg_deps(\"PredictiveEcology/LandR@development\", dependencies = TRUE) # Error: # ! error in pak subprocess # Caused by error: # ! Could not solve package dependencies: # * PredictiveEcology/LandR@development: Can't install dependency BioSIM # * BioSIM: Can't find package called BioSIM. # Type .Last.error to see the more details. ff <- Require::pkgDep(\"PredictiveEcology/LandR@development\", dependencies = TRUE) # $`PredictiveEcology/LandR@development` # [1] \"BH\" \"BIEN\" # [3] \"BioSIM\" \"DBI (>= 0.8)\" # [5] \"Deriv\" \"ENMeval\" # ..."},{"path":[]},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"managing-projects-during-development","dir":"Articles","previous_headings":"renv and Require","what":"Managing projects during development","title":"The `Require` approach, comparing `pak` and `renv`","text":"renv concept lockfile. lockfile records specific version package. current installed version package different lockfile (e.g., developer increment local version), renv attempt revert local changes (prompt confirm) unless local package installed cloud repository (e.g., GitHub), snapshot taken. sequence largely incompatible pkgload::load_all() devtools::install(), record “” get current version . Thus, renv sequence can quite time consuming (1-2 minutes, instead 1 second pkgload::load_all()). Require attempt update anything unless required package. Thus, issue never comes . important “snapshot”, pkgSnapshot pkgSnapshot2 can used.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"using-description-file-to-maintain-minimum-versions","dir":"Articles","previous_headings":"renv and Require","what":"Using DESCRIPTION file to maintain minimum versions","title":"The `Require` approach, comparing `pak` and `renv`","text":"project, user can build maintain “project-level” DESCRIPTION file, can useful renv managed project. approach , however, automatically detect minimum version changes GitHub branch changes (renv::status recognize ). order user inherit correct requirements, manual renv::install must used. even moderate sized projects, can take 20 seconds. Require need lockfile; package violations found fly.","code":""},{"path":"https://Require.predictiveecology.org/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Eliot J B McIntire. Author, maintainer. Alex M Chubaty. Contributor. Majesty Queen Right Canada, represented Minister Natural Resources Canada. Copyright holder.","code":""},{"path":"https://Require.predictiveecology.org/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"McIntire E (2024). Require: Installing Loading R Packages Reproducible Workflows. R package version 1.0.0, https://github.com/PredictiveEcology/Require, https://Require.predictiveecology.org.","code":"@Manual{, title = {Require: Installing and Loading R Packages for Reproducible Workflows}, author = {Eliot J B McIntire}, year = {2024}, note = {R package version 1.0.0, https://github.com/PredictiveEcology/Require}, url = {https://Require.predictiveecology.org}, }"},{"path":"https://Require.predictiveecology.org/index.html","id":"require","dir":"","previous_headings":"","what":"Installing and Loading R Packages for Reproducible Workflows","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Require single package combines features base::install.packages, base::library, base::require, well pak::pkg_install, remotes::install_github, versions::install_version, plus snapshotting capabilities renv. takes name idea user simply one line like : named require function, load packages. Require, also install packages, necessary. Set forget . makes clear packages used project. Require also continues work, even packages taken CRAN. means even dependency removed CRAN (“archived”), line still work. can done one line, becomes relatively easy share, transparent, facilitates reproducibility (especially combined version specifications). turn facilitate, example, making reprexes debugging.","code":"Require(c(\"dplyr\", \"lmer\", \"PredictiveEcology/LandR@development\"))"},{"path":"https://Require.predictiveecology.org/index.html","id":"objectives","dir":"","previous_headings":"","what":"Objectives","title":"Installing and Loading R Packages for Reproducible Workflows","text":"packages many package dependencies. CRAN; development may hosted elsewhere. Mixing many package dependencies constantly evolving creates challenges standard R package management. example, best way move analyses one machine another, set series High Performance Compute nodes? use functions like install.packages reproducible workflow clearly intended used times? deal many packages GitHub many common dependencies, may point different branches GitHub repository? deal packages dependencies longer CRAN (“archived”)? replicate analysis 6 months now packages changed, dependencies changed?","code":""},{"path":"https://Require.predictiveecology.org/index.html","id":"require--install","dir":"","previous_headings":"","what":"Require & Install","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Require package provides two “rerun-tolerant” functions, Require Install. “Rerun-tolerant” means results running function (output) identical time, even conditions run different. means one packages installed prior running function, function determine installed, install continue . packages missing, install anything. function uses RAM disk caching, first time run new R session slower subsequent times cached copies e.g., package dependency tree, can used. “Rerun-tolerant” requirement robust reproducible workflow; every “manual” break code (.e., user runs bit code, skips lines, runs etc.) provides potential sections code become stale without user aware. Install Require identical except Require also call require (lower case r) named packages default setting require = TRUE.","code":""},{"path":"https://Require.predictiveecology.org/index.html","id":"converting-to-using-require","dir":"","previous_headings":"","what":"Converting to using Require","title":"Installing and Loading R Packages for Reproducible Workflows","text":"lines: become: noting Require extra package, fully reproducible, needs installed first.","code":"if (!require(\"dplyr\")) {install.packages(\"dplyr\"); require(\"dplyr\")} if (!require(\"lme4\")) {install.packages(\"lme4\"); require(\"lme4\")} if (!require(\"tidyverse\")) {install.packages(\"tidyverse\"); require(\"tidyverse\")} if (!require(\"Require\")) {install.packages(\"Require\"); require(\"Require\")} Require(c(\"dplyr\", \"lme4\", \"tidyverse\"))"},{"path":"https://Require.predictiveecology.org/index.html","id":"other-packages-that-also-install-packages","dir":"","previous_headings":"","what":"Other packages that also install packages","title":"Installing and Loading R Packages for Reproducible Workflows","text":"descriptions necessarily simple; please go see package details. , highlight key features relevant README. Require offers different way achieve features 5 packages necessary build unified, organic, yet reproducible approach package management one many projects.","code":""},{"path":"https://Require.predictiveecology.org/index.html","id":"pak","dir":"","previous_headings":"Other packages that also install packages","what":"pak","title":"Installing and Loading R Packages for Reproducible Workflows","text":"pak focuses fast installations current versions packages CRAN-like packages GitHub.com similar code-sharing pages. works well objective keep current. fast.","code":"# These lines pak::pkg_install(c(\"dplyr\", \"lme4\")) # become Require::Install(c(\"dplyr\", \"lme4\"))"},{"path":"https://Require.predictiveecology.org/index.html","id":"renv","dir":"","previous_headings":"Other packages that also install packages","what":"renv","title":"Installing and Loading R Packages for Reproducible Workflows","text":"renv tool help static package installation process. can handle packages updated manually individual, key strength around keeping track versions exist project. renv intended expose code used install packages. makes managing packages separate script /used project, .e., package script contain necessary information recreate package library.","code":"renv::snapshot() # becomes Require::pkgSnapshot()"},{"path":"https://Require.predictiveecology.org/index.html","id":"packrat","dir":"","previous_headings":"Other packages that also install packages","what":"packrat","title":"Installing and Loading R Packages for Reproducible Workflows","text":"mostly predecessor renv. renv can everything packrat can , better.","code":""},{"path":"https://Require.predictiveecology.org/index.html","id":"checkpoint","dir":"","previous_headings":"Other packages that also install packages","what":"checkpoint","title":"Installing and Loading R Packages for Reproducible Workflows","text":"approach takes date input install packages user wants, date. uses posit.packagemanager.co servers hosted Posit.","code":"checkpoint(\"2022-11-09\") # cannot be achieved directly with Require, but Require(\"reproducible (==1.2.10)\") # which was the version on that date"},{"path":"https://Require.predictiveecology.org/index.html","id":"package-features","dir":"","previous_headings":"","what":"Package features","title":"Installing and Loading R Packages for Reproducible Workflows","text":"reproducible workflows – rerun-tolerant fast (see one example timings ) packages can CRAN, CRAN-alikes, GitHub.com uses .libPaths() like base-R true stand alone, folder-based approach used .libPaths(). example, user e.g., Windows Home packages installed system folder admin privileges allows , setting standAlone = TRUE ignore packages use ones .libPaths()[1] can use hierarchical library paths can take snapshots, keeping version information reinstallation another machine/system. See ?pkgSnapshot can use binary source installs; yet overrides user request likely inappropriate, e.g., Rcpp often fails installed Linux binary package manager. Spatial packages similar. uses local cache packages (defaults outside project, inside user’s home) multiple projects can install packages quickly without re-downloading cloud repositories (see RequireOptions()$Require.cachePkgDir) puts package installing compact form, can placed within project source code, enhancing reproducibility transparency using function Require::Require, runs require every package, order, supplied packages argument","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/index.html","id":"news","dir":"","previous_headings":"","what":"News","title":"Installing and Loading R Packages for Reproducible Workflows","text":"See updates latest CRAN development versions.","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/index.html","id":"current-release","dir":"","previous_headings":"Installation","what":"Current release","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Install CRAN: Install development version:","code":"install.packages(\"Require\") # Installing the development binary (Windows/MacOS) install.packages(\"Require\", repos = \"https://predictiveecology.r-universe.dev\") # Or installing from source if (!require(\"remotes\")) install.packages(\"remotes\") remotes::install_github(\"PredictiveEcology/Require\")"},{"path":"https://Require.predictiveecology.org/index.html","id":"development-version","dir":"","previous_headings":"Installation","what":"Development version","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Install r-universe: development version package:","code":"install.packages(\"Require\", repose = \"https://predictiveecology.r-universe.dev\")"},{"path":"https://Require.predictiveecology.org/index.html","id":"basic-usage","dir":"","previous_headings":"","what":"Basic usage","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Require wrapper around functions utils::install packages one main function load packages, base::require. Like install.packages, vectorized package names.","code":"if (!require(\"Require\")) {install.packages(\"Require\")} # sadly, Require can't install itself Require::Require(\"data.table\") # With version numbering, this will install data.table, and also check that the installed # version is greater than 1.12.8; if not, then it will install a newer version Require(\"data.table (>=1.12.8)\") # vectorized, mixed github and CRAN, mixed version number and not Require(c(\"data.table (>=1.12.8)\", \"PredictiveEcology/quickPlot\"))"},{"path":"https://Require.predictiveecology.org/index.html","id":"it-is-fast","dir":"","previous_headings":"","what":"It is fast","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Require optimized speed. pak fast, many cases Require faster. , cases packages already installed, Require 10x-20x faster, can left code.","code":"# First time run, > pkgs <- c(\"dplyr\", \"reproducible\", + \"PredictiveEcology/SpaDES@development\", \"terra\") > system.time(pak::pkg_install(pkgs)) ✔ Loading metadata database ... done ℹ No downloads are needed ✔ 4 pkgs + 39 deps: kept 40 [6.8s] user system elapsed 0.79 0.28 6.86 > system.time(Require::Install(pkgs)) 1 packages on GitHub 3 packages on GitHub No packages to install/update user system elapsed 0.44 0.07 0.51 > system.time(pak::pkg_install(pkgs)) # Second time run within same session ℹ No downloads are needed ✔ 4 pkgs + 39 deps: kept 40 [2.1s] user system elapsed 0.06 0.04 2.12 > system.time(Require::Install(pkgs)) No packages to install/update user system elapsed 0.05 0.02 0.06"},{"path":[]},{"path":"https://Require.predictiveecology.org/index.html","id":"keeping-it-all-isolated","dir":"","previous_headings":"Other features","what":"Keeping it all isolated","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Require can make install use single directory, project can fully isolated (unlike .libPaths(), always see packages R_HOME directory)","code":"library(Require) projectPackages = \"projectPackages\" dir.create(projectPackages) Require(\"remotes (>=2.4.0)\", standAlone = TRUE, libPaths = projectPackages)"},{"path":"https://Require.predictiveecology.org/index.html","id":"installing-old-package-versions","dir":"","previous_headings":"Other features","what":"Installing old package versions","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Require functionality renv versions can install previous versions. Windows, search binary version MRAN CRAN Archives. way , can specify maximum exact package versions.","code":"Require(\"fpCompare (<=0.1.0)\") # we don't have to know where to get this"},{"path":"https://Require.predictiveecology.org/index.html","id":"managing-a-project","dir":"","previous_headings":"Other features","what":"Managing a project","title":"Installing and Loading R Packages for Reproducible Workflows","text":"vectorized, can long list packages top project file, various sources version specifications.","code":"Install(c(\"dplyr (==1.1.4)\", \"reproducible\", \"PredictiveEcology/SpaDES@development\", \"raster (>=3.1.5)\"))"},{"path":"https://Require.predictiveecology.org/index.html","id":"taking-a-snapshot","dir":"","previous_headings":"Other features","what":"Taking a snapshot","title":"Installing and Loading R Packages for Reproducible Workflows","text":"system set correct packages versions, can take snapshot give file another person machine: argument packageVersionFile can also TRUE default filename accepted.","code":"library(Require) pkgSnapshot(\"mySnapshot.txt\", standAlone = TRUE) # to get only the project specific ones ## move to a new machine, say Require(packageVersionFile = \"mySnapshot.txt\")"},{"path":"https://Require.predictiveecology.org/index.html","id":"using-local-package-cache","dir":"","previous_headings":"Other features","what":"Using local package cache","title":"Installing and Loading R Packages for Reproducible Workflows","text":"installing many machines network, local cache can speed installations. default, activated, message upon package load cache folder . Setting options(\"Require.cachePkgDir\" = \"somePath\") move location; setting options(\"Require.cachePkgDir\" = NULL) turn caching . default, binaries saved Windows. Also default, binaries built fly *nix systems binary cached even faster installs later.","code":""},{"path":"https://Require.predictiveecology.org/index.html","id":"keeping-up-to-date","dir":"","previous_headings":"Other features","what":"Keeping up to date","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Require generally try keep packages date; instead defaults keeping packages sufficiently date violate version requirements. However, Require 2 mechanisms keep packages date: either group using update = TRUE (upgrade = TRUE) argument Require using (HEAD) specification individual package. Using (HEAD) allows user always latest version individual packages, without wholesale updating.","code":"Require(\"PredictiveEcology/reproducible@development (HEAD)\") # will install reproducible if it has change on GitHub. Require(\"reproducible\", update = TRUE) # will update reproducible and all dependencies"},{"path":"https://Require.predictiveecology.org/index.html","id":"conclusion","dir":"","previous_headings":"","what":"Conclusion","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Require package offers simple package focused around single function “rerun-tolerant”, .e., take sufficiently little time execute can left script run every time, even ongoing work. package two dependencies (data.table sys) can used install packages without interfering .","code":""},{"path":"https://Require.predictiveecology.org/index.html","id":"contributions","dir":"","previous_headings":"","what":"Contributions","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Please see CONTRIBUTING.md information contribute project.","code":""},{"path":"https://Require.predictiveecology.org/reference/DESCRIPTION-helpers.html","id":null,"dir":"Reference","previous_headings":"","what":"GitHub package tools — DESCRIPTIONFileVersionV","title":"GitHub package tools — DESCRIPTIONFileVersionV","text":"series helpers access deal GitHub packages","code":""},{"path":"https://Require.predictiveecology.org/reference/DESCRIPTION-helpers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"GitHub package tools — DESCRIPTIONFileVersionV","text":"","code":"DESCRIPTIONFileVersionV(file, purge = getOption(\"Require.purge\", FALSE)) DESCRIPTIONFileOtherV(file, other = \"RemoteSha\") dlGitHubDESCRIPTION( pkg, purge = getOption(\"Require.purge\", FALSE), verbose = getOption(\"Require.verbose\") )"},{"path":"https://Require.predictiveecology.org/reference/DESCRIPTION-helpers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"GitHub package tools — DESCRIPTIONFileVersionV","text":"file file path DESCRIPTION file purge Logical. caches purged? Default getOption(\"Require.purge\", FALSE). lot internal caching results throughout Require package. help speed reduce calls internet sources. However, sometimes caches must purged. cached values renewed found old, age limit. maximum age can set seconds environment variable R_AVAILABLE_PACKAGES_CACHE_CONTROL_MAX_AGE, unset, defaults 3600 (one hour – see utils::available.packages). Internally, calls available.packages. keyword DESCRIPTION file precedes \":\". rest line retrieved. pkg character string GitHub package specification (c.f. remotes) verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/DESCRIPTION-helpers.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"GitHub package tools — DESCRIPTIONFileVersionV","text":"dlGitHubDESCRIPTION retrieves DESCRIPTION file GitHub.com","code":""},{"path":"https://Require.predictiveecology.org/reference/GitHubTools.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse a github package specification — parseGitHub","title":"Parse a github package specification — parseGitHub","text":"converts specification like PredictiveEcology/Require@development separate columns, \"Account\", \"Repo\", \"Branch\", \"GitSubFolder\" (one)","code":""},{"path":"https://Require.predictiveecology.org/reference/GitHubTools.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse a github package specification — parseGitHub","text":"","code":"parseGitHub(pkgDT, verbose = getOption(\"Require.verbose\"))"},{"path":"https://Require.predictiveecology.org/reference/GitHubTools.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse a github package specification — parseGitHub","text":"pkgDT pkgDT data.table. verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/GitHubTools.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parse a github package specification — parseGitHub","text":"parseGitHub returns data.table added columns.","code":""},{"path":"https://Require.predictiveecology.org/reference/GitHubTools.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Parse a github package specification — parseGitHub","text":"parseGitHub turns single character string representation 3 4: Account, Repo, Branch, SubFolder.","code":""},{"path":"https://Require.predictiveecology.org/reference/R_TESTSomit.html","id":null,"dir":"Reference","previous_headings":"","what":"This environment variable ","title":"This environment variable ","text":"environment variable set : https://github.com/wch/r-source/blob/8b6429feb661b02e2b2b6df1757b31cf1250a33e/src/library/tools/R/testing.R#L472-Lundefined","code":""},{"path":"https://Require.predictiveecology.org/reference/R_TESTSomit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This environment variable ","text":"","code":"R_TESTSomit()"},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":null,"dir":"Reference","previous_headings":"","what":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"single key function, 'Require' makes rerun-tolerant versions 'install.packages' `require` CRAN packages, packages longer CRAN (.e., archived), specific versions packages, GitHub packages. approach developed create reproducible workflows flexible fast enough use development stages, able build snapshots stable package collection found. functions reproducible workflow, package emphasizes functions return result whether first subsequent times running function, subsequent times sufficiently fast can run every time without undue waiting burden user developer. \"one\" function run install.packages CRAN GitHub https://github.com/ packages install specific versions package versions specified either via ()equality (e.g., \"glue (>=1.6.2)\" \"glue (==1.6.2)\" exact version) packageVersionFile. require = TRUE, default, function run require named packages satisfy version requirements. packages already installed (packages supplied), optional version numbers satisfied, \"install\" component skipped.","code":""},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"","code":"Require( packages, packageVersionFile, libPaths, install_githubArgs = list(), install.packagesArgs = list(INSTALL_opts = \"--no-multiarch\"), standAlone = getOption(\"Require.standAlone\", FALSE), install = getOption(\"Require.install\", TRUE), require = getOption(\"Require.require\", TRUE), repos = getOption(\"repos\"), purge = getOption(\"Require.purge\", FALSE), verbose = getOption(\"Require.verbose\", FALSE), type = getOption(\"pkgType\"), upgrade = FALSE, returnDetails = FALSE, ... ) Install( packages, packageVersionFile, libPaths, install_githubArgs = list(), install.packagesArgs = list(INSTALL_opts = \"--no-multiarch\"), standAlone = getOption(\"Require.standAlone\", FALSE), install = TRUE, repos = getOption(\"repos\"), purge = getOption(\"Require.purge\", FALSE), verbose = getOption(\"Require.verbose\", FALSE), type = getOption(\"pkgType\"), upgrade = FALSE, ... )"},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"packages Either character vector packages install via install.packages, load (.e., library), , convenience, vector list (using c list) unquoted package names install /load (require, vectorized). Passing vectors names may work cases, user confirm relying behaviour operational code. case GitHub package, assumed name repository name package. case, pass named character vector , names package names different GitHub repository name. packageVersionFile Character string file name logical. TRUE, function load default file, getOption(\"Require.packageVersionFile\"). argument provided, override packages passed packages. default, Require attempt resolve dependency violations (.e., packageVersionFile specifies version package violates dependency specification another package). user wishes attempt install packageVersionFile without assessing dependencies, set dependencies = FALSE. libPaths library path (libraries) packages installed, looked load (.e., call library). can used create isolated, stand alone package installations, used standAlone = TRUE. Currently, path supplied prepended .libPaths() (temporarily call) Require standAlone = FALSE set (temporarily) .libPaths() c(libPaths, tail(libPaths(), 1) keep base packages. install_githubArgs Deprecated. Values passed merged install.packagesArgs, install.packagesArgs taking precedence conflicting. install.packagesArgs List optional named arguments, passed install.packages. Default ---multi-arch, meaning current architecture built installed (e.g., 64 bit, 32 bit, many cases). standAlone Logical. TRUE, packages installed loaded libPaths . NOTE: TRUE, CHANGE USER'S .libPaths(), similar e.g., checkpoint package. FALSE, libPath prepended .libPaths() Require call, resulting shared packages, .e., include user's default package folder(s). can create dramatically faster installs user substantial number packages already personal library. Default FALSE minimize package installing. install Logical \"force\". FALSE, try install anything. \"force\", force installation requested packages, mimicking call e.g., install.packages. TRUE, default, function try install missing packages dependencies. require Logical character string. TRUE, default, function attempt call require requested packages, possibly installed. character string, call require specific packages (.e., install ones listed packages, load packages listed require) repos remote repository (e.g., CRAN mirror), passed either install.packages, install_github installVersions. purge Logical. caches purged? Default getOption(\"Require.purge\", FALSE). lot internal caching results throughout Require package. help speed reduce calls internet sources. However, sometimes caches must purged. cached values renewed found old, age limit. maximum age can set seconds environment variable R_AVAILABLE_PACKAGES_CACHE_CONTROL_MAX_AGE, unset, defaults 3600 (one hour – see utils::available.packages). Internally, calls available.packages. verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility). type See utils::install.packages upgrade FALSE, default, upgrade package version local library adequate version requirements packages. Note: convenience, update can used argument. returnDetails Logical. TRUE return object attribute: attr(.., \"Require\") lots information processes installs. ... Passed install.packages. Good candidates e.g., type dependencies. can used install_githubArgs install.packageArgs give individual options 2 internal function calls.","code":""},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"Require intended replace base::require, thus returns logical, named vector indicating whether named packages loaded. Require also ability install packages, return value FALSE mean install correctly; rather, means attach require, install correctly, also e.g., require = FALSE. standAlone either put Required packages dependencies within libPaths (TRUE) FALSE install packages dependencies otherwise installed .libPaths()[1], .e., current active R package directory. packages dependencies yet installed installed libPaths.","code":""},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"Install Require(..., require = FALSE), convenience.","code":""},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"advanced use diagnosis, user can set verbose = TRUE 1 2 (via options(\"Require.verbose\")). attach attribute attr(obj, \"Require\") output function.","code":""},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"github-package","dir":"Reference","previous_headings":"","what":"GitHub Package","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"Follows remotes::install_github standard. remotes::install_github, possible specify past version GitHub package unless version tag user passes SHA package version. Similarly, developer local install e.g., via pkgload::install, active project, package able know GitHub state, thus pkgSnapshot able recover state SHA associated local installation. Use Require (remotes::install_github) create record GitHub state.","code":""},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"package-snapshots","dir":"Reference","previous_headings":"","what":"Package Snapshots","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"build snapshot desired packages versions, first run Require packages, pkgSnapshot. libPaths used, must used functions.","code":""},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"mutual-dependencies","dir":"Reference","previous_headings":"","what":"Mutual Dependencies","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"function works best required packages called within one Require call, dependencies can identified together, package versions addressed (conflicts), allowing call pkgSnapshot() take snapshot \"record\" current collection packages versions.","code":""},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"local-cache-of-packages","dir":"Reference","previous_headings":"","what":"Local Cache of Packages","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"installing new packages, Require put source binary files R-version specific subfolder getOption(\"Require.cachePkgDir\") whose default RPackageCache(), meaning cache packages locally project-independent location, reuse needed. turn feature, set options(\"Require.cachePkgDir\" = FALSE).","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"Maintainer: Eliot J B McIntire eliot.mcintire@canada.ca (ORCID) contributors: Alex M Chubaty achubaty@-cast.ca (ORCID) [contributor] Majesty Queen Right Canada, represented Minister Natural Resources Canada [copyright holder]","code":""},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"","code":"if (FALSE) { # \\dontrun{ opts <- Require:::.setupExample() library(Require) getCRANrepos(ind = 1) Require(\"utils\") # analogous to require(stats), but it checks for # pkg dependencies, and installs them, if missing # unquoted version Require(c(tools, utils)) if (Require:::.runLongExamples()) { # Install in a new local library (libPaths) tempPkgFolder <- file.path(tempdir(), \"Require/Packages\") # use standAlone, means it will put it in libPaths, even if it already exists # in another local library (e.g., personal library) Install(\"crayon\", libPaths = tempPkgFolder, standAlone = TRUE) # Mutual dependencies, only installs once -- e.g., cli tempPkgFolder <- file.path(tempdir(), \"Require/Packages\") Install(c(\"cli\", \"R6\"), libPaths = tempPkgFolder, standAlone = TRUE) # Mutual dependencies, only installs once -- e.g., rlang tempPkgFolder <- file.path(tempdir(), \"Require/Packages\") Install(c(\"rlang\", \"ellipsis\"), libPaths = tempPkgFolder, standAlone = TRUE) ##################################################################################### # Isolated projects -- Use a project folder and pass to libPaths or set .libPaths() # ##################################################################################### # GitHub packages if (requireNamespace(\"gitcreds\", quietly = TRUE)) { #if (is(try(gitcreds::gitcreds_get(), silent = TRUE), \"gitcreds\")) { ProjectPackageFolder <- file.path(tempdir(), \"Require/ProjectA\") if (requireNamespace(\"curl\")) { Require(\"PredictiveEcology/fpCompare@development\", libPaths = ProjectPackageFolder, ) } # No install because it is there already Install(\"PredictiveEcology/fpCompare@development\", libPaths = ProjectPackageFolder, ) # the latest version on GitHub ############################################################################ # Mixing and matching GitHub, CRAN, with and without version numbering ############################################################################ pkgs <- c( \"remotes (<=2.4.1)\", # old version \"digest (>= 0.6.28)\", # recent version \"PredictiveEcology/fpCompare@a0260b8476b06628bba0ae73af3430cce9620ca0\" # exact version ) Require::Require(pkgs, libPaths = ProjectPackageFolder) #} } Require:::.cleanup(opts) } } # }"},{"path":"https://Require.predictiveecology.org/reference/RequireOptions.html","id":null,"dir":"Reference","previous_headings":"","what":"Require options — RequireOptions","title":"Require options — RequireOptions","text":"provide top-level, powerful settings comprehensive reproducible workflow. See Details .","code":""},{"path":"https://Require.predictiveecology.org/reference/RequireOptions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Require options — RequireOptions","text":"","code":"RequireOptions() getRequireOptions()"},{"path":"https://Require.predictiveecology.org/reference/RequireOptions.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Require options — RequireOptions","text":"RequireOptions() prints default values package options set startup, may changed (e.g., user) current session. getRequireOptions() prints current values package options. options can set options(\"Require.xxx\" = newValue), xxx one values , newValue new value give option. Sometimes options can placed user's .Rprofile file persist sessions. following options likely interest users: install Default: TRUE. default argument Require, affect Install. FALSE, installations attempted, missing packages result error. RPackageCache Default: cacheGetOptionCachePkgDir(), must either path logical. turn package caching, set FALSE. can set using environment variable e.g. Sys.setenv(R_REQUIRE_PKG_CACHE = \"somePath\"), Sys.setenv(R_REQUIRE_PKG_CACHE = \"TRUE\"); set, either path logical option (options(Require.cachePkgDir = \"somePath\") options(Require.cachePkgDir = TRUE)). TRUE, default folder location cachePkgDir() used. TRUE path provided, binary source packages cached . Subsequent downloads package use local copy. Default packages cached locally install version original source, e.g., CRAN, GitHub. otherPkgs Default: character vector packages generally successful installed Source Unix-alikes. Since repositories offer binary packages builds Linux (e.g., RStudio Package Manager), vector package names indicated default standard CRAN repository, forcing source install. See also spatialPkgs option, spatial packages. purge Default: FALSE. set (almost) internal caches used Require deleted rebuilt. generally necessary automatically deleted (default) 1 hour (set via R_AVAILABLE_PACKAGES_CACHE_CONTROL_MAX_AGE environment variable seconds) spatialPkgs Default: character vector packages generally successful installed Source Unix-alikes. Since repositories offer binary packages builds Linux (e.g., RStudio Package Manager), vector package names indicated default standard CRAN repository, forcing source install. See also otherPkgs option, non-spatial packages. useCranCache Default: FALSE. user can optionally use locally cached packages available due user's use crancache package. verbose Default: 1. See ?Require.","code":""},{"path":"https://Require.predictiveecology.org/reference/availablePackagesOverride.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a custom ","title":"Create a custom ","text":"mechanism install.packages determines packages installed . override, can indicate arbitrary repos, Package, File individual package.","code":""},{"path":"https://Require.predictiveecology.org/reference/availablePackagesOverride.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a custom ","text":"","code":"availablePackagesOverride( toInstall, repos, purge, type = getOption(\"pkgType\"), verbose = getOption(\"Require.verbose\") )"},{"path":"https://Require.predictiveecology.org/reference/availablePackagesOverride.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a custom ","text":"toInstall pkgDT object repos remote repository (e.g., CRAN mirror), passed either install.packages, install_github installVersions. purge Logical. caches purged? Default getOption(\"Require.purge\", FALSE). lot internal caching results throughout Require package. help speed reduce calls internet sources. However, sometimes caches must purged. cached values renewed found old, age limit. maximum age can set seconds environment variable R_AVAILABLE_PACKAGES_CACHE_CONTROL_MAX_AGE, unset, defaults 3600 (one hour – see utils::available.packages). Internally, calls available.packages. type See utils::install.packages verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/availableVersionOK.html","id":null,"dir":"Reference","previous_headings":"","what":"Needs VersionOnRepos, versionSpec and inequality columns — availableVersionOK","title":"Needs VersionOnRepos, versionSpec and inequality columns — availableVersionOK","text":"Needs VersionOnRepos, versionSpec inequality columns","code":""},{"path":"https://Require.predictiveecology.org/reference/availableVersionOK.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Needs VersionOnRepos, versionSpec and inequality columns — availableVersionOK","text":"","code":"availableVersionOK(pkgDT)"},{"path":"https://Require.predictiveecology.org/reference/availableVersionOK.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Needs VersionOnRepos, versionSpec and inequality columns — availableVersionOK","text":"pkgDT pkgDT object","code":""},{"path":"https://Require.predictiveecology.org/reference/availableVersions.html","id":null,"dir":"Reference","previous_headings":"","what":"Available and archived versions — dlArchiveVersionsAvailable","title":"Available and archived versions — dlArchiveVersionsAvailable","text":"wrappers around available.packages also get archived versions available CRAN.","code":""},{"path":"https://Require.predictiveecology.org/reference/availableVersions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Available and archived versions — dlArchiveVersionsAvailable","text":"","code":"dlArchiveVersionsAvailable( package, repos = getOption(\"repos\"), verbose = getOption(\"Require.verbose\") ) available.packagesCached( repos, purge, verbose = getOption(\"Require.verbose\"), returnDataTable = TRUE, type )"},{"path":"https://Require.predictiveecology.org/reference/availableVersions.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Available and archived versions — dlArchiveVersionsAvailable","text":"package single package name (without version github specifications) repos remote repository (e.g., CRAN mirror), passed either install.packages, install_github installVersions. verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility). purge Logical. caches purged? Default getOption(\"Require.purge\", FALSE). lot internal caching results throughout Require package. help speed reduce calls internet sources. However, sometimes caches must purged. cached values renewed found old, age limit. maximum age can set seconds environment variable R_AVAILABLE_PACKAGES_CACHE_CONTROL_MAX_AGE, unset, defaults 3600 (one hour – see utils::available.packages). Internally, calls available.packages. returnDataTable Logical. TRUE, default, return data.table. Otherwise, matrix, per available.packages type See utils::install.packages","code":""},{"path":"https://Require.predictiveecology.org/reference/availableVersions.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Available and archived versions — dlArchiveVersionsAvailable","text":"dlArchiveVersionsAvailable searches CRAN Archives available versions. borrowed sub-set code non-exported function: remotes:::download_version_url","code":""},{"path":"https://Require.predictiveecology.org/reference/cacheDefaultDir.html","id":null,"dir":"Reference","previous_headings":"","what":"The default cache directory for Require Cache — cacheDefaultDir","title":"The default cache directory for Require Cache — cacheDefaultDir","text":"wrapper around tools::R_user_dir(\"Require\", = \"cache\") creates directory, exist.","code":""},{"path":"https://Require.predictiveecology.org/reference/cacheDefaultDir.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The default cache directory for Require Cache — cacheDefaultDir","text":"","code":"cacheDefaultDir()"},{"path":"https://Require.predictiveecology.org/reference/cacheDefaultDir.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"The default cache directory for Require Cache — cacheDefaultDir","text":"default cache directory","code":""},{"path":"https://Require.predictiveecology.org/reference/cacheDir.html","id":null,"dir":"Reference","previous_headings":"","what":"Path to (package) cache directory — cacheDir","title":"Path to (package) cache directory — cacheDir","text":"Sets (create = TRUE) gets cache directory associated Require package.","code":""},{"path":"https://Require.predictiveecology.org/reference/cacheDir.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Path to (package) cache directory — cacheDir","text":"","code":"cacheDir(create, verbose = getOption(\"Require.verbose\")) cachePkgDir(create)"},{"path":"https://Require.predictiveecology.org/reference/cacheDir.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Path to (package) cache directory — cacheDir","text":"create logical indicating whether path created exist. Default FALSE. verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/cacheDir.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Path to (package) cache directory — cacheDir","text":"!.null(cacheGetOptionCachePkgDir()), .e., cache path exists, cache directory created, README placed folder. Otherwise, function just return path cache directory .","code":""},{"path":"https://Require.predictiveecology.org/reference/cacheDir.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Path to (package) cache directory — cacheDir","text":"set different directory default, set system variable: R_USER_CACHE_DIR = \"somePath\" /R_REQUIRE_PKG_CACHE = \"somePath\" e.g., .Renviron file Sys.setenv(). See Note .","code":""},{"path":"https://Require.predictiveecology.org/reference/cacheDir.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Path to (package) cache directory — cacheDir","text":"Currently, 2 different Cache directories used Require: cacheDir cachePkgDir. cachePkgDir intended sub-directory cacheDir. set Sys.setenv(\"R_USER_CACHE_DIR\" = \"somedir\"), package cache cache dirs set, package cache sub-directory. can, however, set independently, set \"R_USER_CACHE_DIR\" \"R_REQUIRE_PKG_CACHE\" environment variable. package cache can also set options(\"Require.cachePkgDir\" = \"somedir\").","code":""},{"path":"https://Require.predictiveecology.org/reference/cacheGetOptionCachePkgDir.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the option for Require.cachePkgDir — cacheGetOptionCachePkgDir","title":"Get the option for Require.cachePkgDir — cacheGetOptionCachePkgDir","text":"First checks environment variable Require.cachePkgDir set defines path. set, checks whether options(\"Require.cachePkgDir\") set. character string, returns . TRUE, use cachePkgDir(). FALSE returns NULL.","code":""},{"path":"https://Require.predictiveecology.org/reference/cacheGetOptionCachePkgDir.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the option for Require.cachePkgDir — cacheGetOptionCachePkgDir","text":"","code":"cacheGetOptionCachePkgDir()"},{"path":"https://Require.predictiveecology.org/reference/cachePurge.html","id":null,"dir":"Reference","previous_headings":"","what":"Purge everything in the Require cache — cachePurge","title":"Purge everything in the Require cache — cachePurge","text":"Require uses caches local Package saving, local caches available.packages, local caches GitHub (e.g., \"DESCRIPTION\") files, function calls cached. function clears .","code":""},{"path":"https://Require.predictiveecology.org/reference/cachePurge.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Purge everything in the Require cache — cachePurge","text":"","code":"cachePurge(packages = FALSE, repos = getOption(\"repos\")) purgeCache(packages = FALSE, repos = getOption(\"repos\"))"},{"path":"https://Require.predictiveecology.org/reference/cachePurge.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Purge everything in the Require cache — cachePurge","text":"packages Either character vector packages install via install.packages, load (.e., library), , convenience, vector list (using c list) unquoted package names install /load (require, vectorized). Passing vectors names may work cases, user confirm relying behaviour operational code. case GitHub package, assumed name repository name package. case, pass named character vector , names package names different GitHub repository name. repos remote repository (e.g., CRAN mirror), passed either install.packages, install_github installVersions.","code":""},{"path":"https://Require.predictiveecology.org/reference/cachePurge.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Purge everything in the Require cache — cachePurge","text":"Run side effect, namely, cached objects removed.","code":""},{"path":"https://Require.predictiveecology.org/reference/checkLibPaths.html","id":null,"dir":"Reference","previous_headings":"","what":"Creates the directories, and adds version number — checkLibPaths","title":"Creates the directories, and adds version number — checkLibPaths","text":"Creates directories, adds version number","code":""},{"path":"https://Require.predictiveecology.org/reference/checkLibPaths.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates the directories, and adds version number — checkLibPaths","text":"","code":"checkLibPaths(libPaths, ifMissing, exact = FALSE, ...)"},{"path":"https://Require.predictiveecology.org/reference/checkLibPaths.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates the directories, and adds version number — checkLibPaths","text":"libPaths library path (libraries) packages installed, looked load (.e., call library). can used create isolated, stand alone package installations, used standAlone = TRUE. Currently, path supplied prepended .libPaths() (temporarily call) Require standAlone = FALSE set (temporarily) .libPaths() c(libPaths, tail(libPaths(), 1) keep base packages. ifMissing alternative path libPaths argument missing. exact Logical. FALSE, default, checkLibPaths append R version number libPaths supplied. TRUE, checkLibPaths return exactly libPaths supplied. ... used, allows functions pass arguments.","code":""},{"path":"https://Require.predictiveecology.org/reference/checkPath.html","id":null,"dir":"Reference","previous_headings":"","what":"Check directory path — checkPath","title":"Check directory path — checkPath","text":"Checks specified path directory formatting consistencies, trailing slashes, etc.","code":""},{"path":"https://Require.predictiveecology.org/reference/checkPath.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check directory path — checkPath","text":"","code":"checkPath(path, create) # S4 method for class 'character,logical' checkPath(path, create) # S4 method for class 'character,missing' checkPath(path) # S4 method for class 'NULL,ANY' checkPath(path) # S4 method for class 'missing,ANY' checkPath()"},{"path":"https://Require.predictiveecology.org/reference/checkPath.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check directory path — checkPath","text":"path character string corresponding directory path. create logical indicating whether path created exist. Default FALSE.","code":""},{"path":"https://Require.predictiveecology.org/reference/checkPath.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check directory path — checkPath","text":"Character string denoting cleaned filepath.","code":""},{"path":"https://Require.predictiveecology.org/reference/checkPath.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Check directory path — checkPath","text":"work paths files. check existence files, use file.exists(). normalize path file, use normPath() normalizePath().","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/reference/checkPath.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check directory path — checkPath","text":"","code":"## normalize file paths paths <- list(\"./aaa/zzz\", \"./aaa/zzz/\", \".//aaa//zzz\", \".//aaa//zzz/\", \".\\\\\\\\aaa\\\\\\\\zzz\", \".\\\\\\\\aaa\\\\\\\\zzz\\\\\\\\\", file.path(\".\", \"aaa\", \"zzz\")) checked <- normPath(paths) length(unique(checked)) ## 1; all of the above are equivalent #> [1] 3 ## check to see if a path exists tmpdir <- file.path(tempdir(), \"example_checkPath\") dir.exists(tmpdir) ## FALSE #> [1] FALSE tryCatch(checkPath(tmpdir, create = FALSE), error = function(e) FALSE) ## FALSE #> [1] FALSE checkPath(tmpdir, create = TRUE) #> [1] \"/tmp/RtmpbnaRVg/example_checkPath\" dir.exists(tmpdir) ## TRUE #> [1] TRUE unlink(tmpdir, recursive = TRUE) # clean up"},{"path":"https://Require.predictiveecology.org/reference/chooseCRANmirror2.html","id":null,"dir":"Reference","previous_headings":"","what":"Pass through function for chooseCRANmirror — chooseCRANmirror2","title":"Pass through function for chooseCRANmirror — chooseCRANmirror2","text":"allow mocking unit testing related chooseCRANmirror.","code":""},{"path":"https://Require.predictiveecology.org/reference/chooseCRANmirror2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pass through function for chooseCRANmirror — chooseCRANmirror2","text":"","code":"chooseCRANmirror2(...)"},{"path":"https://Require.predictiveecology.org/reference/chooseCRANmirror2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pass through function for chooseCRANmirror — chooseCRANmirror2","text":"... Passed chooseCRANmirror","code":""},{"path":"https://Require.predictiveecology.org/reference/clearRequire.html","id":null,"dir":"Reference","previous_headings":"","what":"Clear Require Cache elements — cacheClearPackages","title":"Clear Require Cache elements — cacheClearPackages","text":"Clear Require Cache elements","code":""},{"path":"https://Require.predictiveecology.org/reference/clearRequire.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clear Require Cache elements — cacheClearPackages","text":"","code":"cacheClearPackages( packages, ask = interactive(), Rversion = versionMajorMinor(), clearCranCache = FALSE, verbose = getOption(\"Require.verbose\") ) clearRequirePackageCache( packages, ask = interactive(), Rversion = versionMajorMinor(), clearCranCache = FALSE, verbose = getOption(\"Require.verbose\") )"},{"path":"https://Require.predictiveecology.org/reference/clearRequire.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clear Require Cache elements — cacheClearPackages","text":"packages Either missing character vector package names (currently specify version number) remove local Require Cache. ask Logical. TRUE, ask user confirm Rversion R version (major dot minor, e.g., \"4.2\"). Defaults current R version. clearCranCache Logical. TRUE, also clear local crancache cache, relevant options(Require.useCranCache = TRUE), .e., Require using crancache cache also verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/compareVersion2.html","id":null,"dir":"Reference","previous_headings":"","what":"Compare package versions — compareVersion2","title":"Compare package versions — compareVersion2","text":"Alternative utils::compareVersion vectorized version, versionSpec /inequality. also return NA element returned vector one arguments NA element.","code":""},{"path":"https://Require.predictiveecology.org/reference/compareVersion2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compare package versions — compareVersion2","text":"","code":"compareVersion2(version, versionSpec, inequality)"},{"path":"https://Require.predictiveecology.org/reference/compareVersion2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compare package versions — compareVersion2","text":"version One package versions. Can character numeric_version. versionSpec One versions compare . Can character numeric_version. inequality inequality use, .e., >=.","code":""},{"path":"https://Require.predictiveecology.org/reference/compareVersion2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compare package versions — compareVersion2","text":"logical vector length longest 3 arguments.","code":""},{"path":"https://Require.predictiveecology.org/reference/dealWithMissingLibPaths.html","id":null,"dir":"Reference","previous_headings":"","what":"Only checks for deprecated libPath argument (singular) — dealWithMissingLibPaths","title":"Only checks for deprecated libPath argument (singular) — dealWithMissingLibPaths","text":"checks deprecated libPath argument (singular)","code":""},{"path":"https://Require.predictiveecology.org/reference/dealWithMissingLibPaths.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Only checks for deprecated libPath argument (singular) — dealWithMissingLibPaths","text":"","code":"dealWithMissingLibPaths( libPaths, standAlone = getOption(\"Require.standAlone\", FALSE), ... )"},{"path":"https://Require.predictiveecology.org/reference/dealWithMissingLibPaths.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Only checks for deprecated libPath argument (singular) — dealWithMissingLibPaths","text":"libPaths library path (libraries) packages installed, looked load (.e., call library). can used create isolated, stand alone package installations, used standAlone = TRUE. Currently, path supplied prepended .libPaths() (temporarily call) Require standAlone = FALSE set (temporarily) .libPaths() c(libPaths, tail(libPaths(), 1) keep base packages. standAlone Logical. TRUE, packages installed loaded libPaths . NOTE: TRUE, CHANGE USER'S .libPaths(), similar e.g., checkpoint package. FALSE, libPath prepended .libPaths() Require call, resulting shared packages, .e., include user's default package folder(s). can create dramatically faster installs user substantial number packages already personal library. Default FALSE minimize package installing. ... Checks incorrect argument libPath (s)","code":""},{"path":"https://Require.predictiveecology.org/reference/detachAll.html","id":null,"dir":"Reference","previous_headings":"","what":"Detach and unload all packages — detachAll","title":"Detach and unload all packages — detachAll","text":"uses pkgDepTopoSort internally package dependency tree determined, packages unloaded reverse order. packages unload successfully variety reasons. Several known packages problem identified internally unloaded. Currently, glue, rlang, ps, ellipsis, , processx.","code":""},{"path":"https://Require.predictiveecology.org/reference/detachAll.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detach and unload all packages — detachAll","text":"","code":"detachAll( pkgs, dontTry = NULL, doSort = TRUE, verbose = getOption(\"Require.verbose\") )"},{"path":"https://Require.predictiveecology.org/reference/detachAll.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detach and unload all packages — detachAll","text":"pkgs character vector packages detach. topologically sorted unless doSort FALSE. dontTry character vector packages try. can used user find package fails attempts unload , e.g., \"ps\" doSort TRUE (default), pkgs topologically sorted. FALSE, . Useful pkgs already sorted. verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/detachAll.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Detach and unload all packages — detachAll","text":"numeric named vector, names packages attempted. 2 means package successfully unloaded, 1 tried, failed, 3 loaded, unloaded.","code":""},{"path":"https://Require.predictiveecology.org/reference/doLibPaths.html","id":null,"dir":"Reference","previous_headings":"","what":"Deals with missing libPaths arg, and takes first — doLibPaths","title":"Deals with missing libPaths arg, and takes first — doLibPaths","text":"Deals missing libPaths arg, takes first","code":""},{"path":"https://Require.predictiveecology.org/reference/doLibPaths.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Deals with missing libPaths arg, and takes first — doLibPaths","text":"","code":"doLibPaths(libPaths, standAlone = FALSE)"},{"path":"https://Require.predictiveecology.org/reference/doLibPaths.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Deals with missing libPaths arg, and takes first — doLibPaths","text":"libPaths library path (libraries) packages installed, looked load (.e., call library). can used create isolated, stand alone package installations, used standAlone = TRUE. Currently, path supplied prepended .libPaths() (temporarily call) Require standAlone = FALSE set (temporarily) .libPaths() c(libPaths, tail(libPaths(), 1) keep base packages. standAlone Logical. TRUE, packages installed loaded libPaths . NOTE: TRUE, CHANGE USER'S .libPaths(), similar e.g., checkpoint package. FALSE, libPath prepended .libPaths() Require call, resulting shared packages, .e., include user's default package folder(s). can create dramatically faster installs user substantial number packages already personal library. Default FALSE minimize package installing.","code":""},{"path":"https://Require.predictiveecology.org/reference/dot-downloadFileMasterMainAuth.html","id":null,"dir":"Reference","previous_headings":"","what":"GITHUB_PAT-aware and main-master-aware download from GitHub — .downloadFileMasterMainAuth","title":"GITHUB_PAT-aware and main-master-aware download from GitHub — .downloadFileMasterMainAuth","text":"Equivalent utils::download.file, taking GITHUB_PAT environment variable using access Github url.","code":""},{"path":"https://Require.predictiveecology.org/reference/dot-downloadFileMasterMainAuth.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"GITHUB_PAT-aware and main-master-aware download from GitHub — .downloadFileMasterMainAuth","text":"","code":".downloadFileMasterMainAuth( url, destfile, need = \"HEAD\", verbose = getOption(\"Require.verbose\"), verboseLevel = 2 )"},{"path":"https://Require.predictiveecology.org/reference/dot-downloadFileMasterMainAuth.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"GITHUB_PAT-aware and main-master-aware download from GitHub — .downloadFileMasterMainAuth","text":"url character string (longer vector \"libcurl\" method) naming URL resource downloaded. destfile character string (vector, see url argument) file path downloaded file saved. Tilde-expansion performed. need specified, user can suggest master main HEAD try first. unspecified, HEAD used. verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility). verboseLevel numeric indicating verbose threshold (level) message show.","code":""},{"path":"https://Require.predictiveecology.org/reference/dot-downloadFileMasterMainAuth.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"GITHUB_PAT-aware and main-master-aware download from GitHub — .downloadFileMasterMainAuth","text":"called side effect, namely, utils::download.file, using GITHUB_PAT, environment, trying master main actual url specifies either master main exist.","code":""},{"path":"https://Require.predictiveecology.org/reference/dot-installed.pkgs.html","id":null,"dir":"Reference","previous_headings":"","what":"Partial alternative (faster) to installed.packages — .installed.pkgs","title":"Partial alternative (faster) to installed.packages — .installed.pkgs","text":"reads DESCRIPTION files , can access fields available DESCRIPTION file. different installed.packages many fields, like \"Built\", \"NeedsCompilation\" etc. fields needed, function return empty column returned character matrix.","code":""},{"path":"https://Require.predictiveecology.org/reference/dot-installed.pkgs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Partial alternative (faster) to installed.packages — .installed.pkgs","text":"","code":".installed.pkgs( lib.loc = .libPaths(), which = c(\"Depends\", \"Imports\", \"LinkingTo\"), other = NULL, purge = getOption(\"Require.purge\", FALSE), packages = NULL, collapse = FALSE )"},{"path":"https://Require.predictiveecology.org/reference/dot-installed.pkgs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Partial alternative (faster) to installed.packages — .installed.pkgs","text":"lib.loc character vector describing location R library trees search , NULL known trees (see .libPaths). character vector listing types dependencies, subset c(\"Depends\", \"Imports\", \"LinkingTo\", \"Suggests\", \"Enhances\"). Character string \"\" shorthand vector, character string \"\" vector without \"Enhances\". Can supply fields; benefit user can specify \"github\" (lower case) automatically add c(\"GithubRepo\", \"GithubUsername\", \"GithubRef\", \"GithubSHA1\", \"GithubSubFolder\") fields purge Logical. caches purged? Default getOption(\"Require.purge\", FALSE). lot internal caching results throughout Require package. help speed reduce calls internet sources. However, sometimes caches must purged. cached values renewed found old, age limit. maximum age can set seconds environment variable R_AVAILABLE_PACKAGES_CACHE_CONTROL_MAX_AGE, unset, defaults 3600 (one hour – see utils::available.packages). Internally, calls available.packages. packages Character vector. NULL (default), installed packages searched . character vector supplied, return information packages (thus faster execute). collapse Logical. TRUE dependency fields collapsed; FALSE (default) fields kept separate.","code":""},{"path":"https://Require.predictiveecology.org/reference/envPkgCreate.html","id":null,"dir":"Reference","previous_headings":"","what":"1st level –> create the .pkgEnv object in Require — envPkgCreate","title":"1st level –> create the .pkgEnv object in Require — envPkgCreate","text":"1st level –> create .pkgEnv object Require","code":""},{"path":"https://Require.predictiveecology.org/reference/envPkgCreate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"1st level –> create the .pkgEnv object in Require — envPkgCreate","text":"","code":"envPkgCreate(parentEnv = asNamespace(\"Require\"))"},{"path":"https://Require.predictiveecology.org/reference/envPkgCreate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"1st level –> create the .pkgEnv object in Require — envPkgCreate","text":"parentEnv parent environment make new environment. Defaults asNamespace(\"Require\")","code":""},{"path":"https://Require.predictiveecology.org/reference/envPkgDepDESCFileCreate.html","id":null,"dir":"Reference","previous_headings":"","what":"3rd level for DESCRIPTIONFile — envPkgDepDESCFileCreate","title":"3rd level for DESCRIPTIONFile — envPkgDepDESCFileCreate","text":"3rd level DESCRIPTIONFile","code":""},{"path":"https://Require.predictiveecology.org/reference/envPkgDepDESCFileCreate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"3rd level for DESCRIPTIONFile — envPkgDepDESCFileCreate","text":"","code":"envPkgDepDESCFileCreate()"},{"path":"https://Require.predictiveecology.org/reference/envPkgDepDepsCreate.html","id":null,"dir":"Reference","previous_headings":"","what":"3rd level for deps ############################################# — envPkgDepDepsCreate","title":"3rd level for deps ############################################# — envPkgDepDepsCreate","text":"3rd level deps #############################################","code":""},{"path":"https://Require.predictiveecology.org/reference/envPkgDepDepsCreate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"3rd level for deps ############################################# — envPkgDepDepsCreate","text":"","code":"envPkgDepDepsCreate()"},{"path":"https://Require.predictiveecology.org/reference/extractPkgName.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract info from package character strings — extractPkgName","title":"Extract info from package character strings — extractPkgName","text":"Cleans character vector non-package name related information (e.g., version)","code":""},{"path":"https://Require.predictiveecology.org/reference/extractPkgName.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract info from package character strings — extractPkgName","text":"","code":"extractPkgName(pkgs, filenames) extractVersionNumber(pkgs, filenames) extractInequality(pkgs) extractPkgGitHub(pkgs)"},{"path":"https://Require.predictiveecology.org/reference/extractPkgName.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract info from package character strings — extractPkgName","text":"pkgs character string vector packages without GitHub path versions filenames Can supplied instead pkgs filename e.g., .tar.gz .zip downloaded CRAN.","code":""},{"path":"https://Require.predictiveecology.org/reference/extractPkgName.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract info from package character strings — extractPkgName","text":"Just package names without extraneous info.","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/reference/extractPkgName.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract info from package character strings — extractPkgName","text":"","code":"extractPkgName(\"Require (>=0.0.1)\") #> [1] \"Require\" extractVersionNumber(c( \"Require (<=0.0.1)\", \"PredictiveEcology/Require@development (<=0.0.4)\" )) #> [1] \"0.0.1\" \"0.0.4\" extractInequality(\"Require (<=0.0.1)\") #> [1] \"<=\" extractPkgGitHub(\"PredictiveEcology/Require\") #> [1] \"Require\""},{"path":"https://Require.predictiveecology.org/reference/getCRANrepos.html","id":null,"dir":"Reference","previous_headings":"","what":"A helper function to get or set CRAN repos — getCRANrepos","title":"A helper function to get or set CRAN repos — getCRANrepos","text":"get current option getOption('repos'), set url, prompt user select mirror, unless ind set, case, use mirror (chooseCRANmirror())","code":""},{"path":"https://Require.predictiveecology.org/reference/getCRANrepos.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A helper function to get or set CRAN repos — getCRANrepos","text":"","code":"getCRANrepos(repos = NULL, ind)"},{"path":"https://Require.predictiveecology.org/reference/getCRANrepos.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A helper function to get or set CRAN repos — getCRANrepos","text":"repos CRAN-like repository ind integer mirror use chooseCRANmirror()","code":""},{"path":"https://Require.predictiveecology.org/reference/getDeps.html","id":null,"dir":"Reference","previous_headings":"","what":"The packages argument may have up to 4 pieces of information for GitHub packages: name, repository, branch, version. For CRAN-alikes, it will only be 2 pieces: name, version. There can also be an inequality or equality, if there is a version. — getDeps","title":"The packages argument may have up to 4 pieces of information for GitHub packages: name, repository, branch, version. For CRAN-alikes, it will only be 2 pieces: name, version. There can also be an inequality or equality, if there is a version. — getDeps","text":"packages argument may 4 pieces information GitHub packages: name, repository, branch, version. CRAN-alikes, 2 pieces: name, version. can also inequality equality, version.","code":""},{"path":"https://Require.predictiveecology.org/reference/getDeps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The packages argument may have up to 4 pieces of information for GitHub packages: name, repository, branch, version. For CRAN-alikes, it will only be 2 pieces: name, version. There can also be an inequality or equality, if there is a version. — getDeps","text":"","code":"getDeps(pkgDT, which, recursive, type = type, repos, libPaths, verbose)"},{"path":"https://Require.predictiveecology.org/reference/getDeps.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"The packages argument may have up to 4 pieces of information for GitHub packages: name, repository, branch, version. For CRAN-alikes, it will only be 2 pieces: name, version. There can also be an inequality or equality, if there is a version. — getDeps","text":"pkgDT pkgDT object e.g., toPkgDT character vector listing types dependencies, subset c(\"Depends\", \"Imports\", \"LinkingTo\", \"Suggests\", \"Enhances\"). Character string \"\" shorthand vector, character string \"\" vector without \"Enhances\". recursive Logical. dependencies dependencies searched, recursively. NOTE: Dependencies suggests recursive. Default TRUE. type See utils::install.packages repos used ap. libPaths path search installed packages. Defaults .libPaths() verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/getDeps.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"The packages argument may have up to 4 pieces of information for GitHub packages: name, repository, branch, version. For CRAN-alikes, it will only be 2 pieces: name, version. There can also be an inequality or equality, if there is a version. — getDeps","text":"(named) vector SaveNames, concatenation 2 4 elements , plus recursive.","code":""},{"path":"https://Require.predictiveecology.org/reference/getDeps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"The packages argument may have up to 4 pieces of information for GitHub packages: name, repository, branch, version. For CRAN-alikes, it will only be 2 pieces: name, version. There can also be an inequality or equality, if there is a version. — getDeps","text":"version supplied, take local, installed version, exists. Otherwise, assumed HEAD desired. function find ap github.com. github packages, obviously slow step, can accelerated user supplies sha version e.g., getDeps(\"PredictiveEcology/LandR@development (==1.0.2)\")","code":""},{"path":"https://Require.predictiveecology.org/reference/invertList.html","id":null,"dir":"Reference","previous_headings":"","what":"Invert a 2-level list — invertList","title":"Invert a 2-level list — invertList","text":"simple version purrr::transpose, lists 2 levels.","code":""},{"path":"https://Require.predictiveecology.org/reference/invertList.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Invert a 2-level list — invertList","text":"","code":"invertList(l)"},{"path":"https://Require.predictiveecology.org/reference/invertList.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Invert a 2-level list — invertList","text":"l list 2 levels. levels absent, NULL","code":""},{"path":"https://Require.predictiveecology.org/reference/invertList.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Invert a 2-level list — invertList","text":"list 2 levels deep, inverted l","code":""},{"path":"https://Require.predictiveecology.org/reference/invertList.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Invert a 2-level list — invertList","text":"","code":"# create a 2-deep, 2 levels in first, 3 levels in second a <- list(a = list(d = 1, e = 2:3, f = 4:6), b = list(d = 5, e = 55)) invertList(a) # creates 2-deep, now 3 levels outer --> 2 levels inner #> $d #> $d$a #> [1] 1 #> #> $d$b #> [1] 5 #> #> #> $e #> $e$a #> [1] 2 3 #> #> $e$b #> [1] 55 #> #> #> $f #> $f$a #> [1] 4 5 6 #> #> $f$b #> NULL #> #>"},{"path":"https://Require.predictiveecology.org/reference/joinToAvailablePackages.html","id":null,"dir":"Reference","previous_headings":"","what":"Join a data.table with a Package column to available.packages — joinToAvailablePackages","title":"Join a data.table with a Package column to available.packages — joinToAvailablePackages","text":"join available.packages() pkgDT, pkgDT already column named Depends, indicator already happened.","code":""},{"path":"https://Require.predictiveecology.org/reference/joinToAvailablePackages.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Join a data.table with a Package column to available.packages — joinToAvailablePackages","text":"","code":"joinToAvailablePackages(pkgDT, repos, type, which, verbose)"},{"path":"https://Require.predictiveecology.org/reference/joinToAvailablePackages.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Join a data.table with a Package column to available.packages — joinToAvailablePackages","text":"pkgDT pkgDT object e.g., toPkgDT repos used ap. type See utils::install.packages character vector listing types dependencies, subset c(\"Depends\", \"Imports\", \"LinkingTo\", \"Suggests\", \"Enhances\"). Character string \"\" shorthand vector, character string \"\" vector without \"Enhances\". verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/joinToAvailablePackages.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Join a data.table with a Package column to available.packages — joinToAvailablePackages","text":"returned data.table columns available.packages appended pkgDT, including Depends, Imports, Suggests. change column name normally returned available.packages Version VersionOnRepos.","code":""},{"path":"https://Require.predictiveecology.org/reference/linkOrCopy.html","id":null,"dir":"Reference","previous_headings":"","what":"Create link to file, falling back to making a copy if linking fails. — linkOrCopy","title":"Create link to file, falling back to making a copy if linking fails. — linkOrCopy","text":"First try create hardlink file. fails, try symbolic link (symlink) falling back copying file. \"File\" can mean file directory.","code":""},{"path":"https://Require.predictiveecology.org/reference/linkOrCopy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create link to file, falling back to making a copy if linking fails. — linkOrCopy","text":"","code":"linkOrCopy(from, to, allowSymlink = FALSE) fileRenameOrMove(from, to)"},{"path":"https://Require.predictiveecology.org/reference/linkOrCopy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create link to file, falling back to making a copy if linking fails. — linkOrCopy","text":", character vectors, containing file names paths. allowSymlink Logical. FALSE, default, try file.link first, file.copy, omitting file.symlink step","code":""},{"path":"https://Require.predictiveecology.org/reference/masterMainToHead.html","id":null,"dir":"Reference","previous_headings":"","what":"This converts master or main to HEAD for a git repo — masterMainToHead","title":"This converts master or main to HEAD for a git repo — masterMainToHead","text":"also convert git repo nothing @ @HEAD","code":""},{"path":"https://Require.predictiveecology.org/reference/masterMainToHead.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This converts master or main to HEAD for a git repo — masterMainToHead","text":"","code":"masterMainToHead(gitRepo)"},{"path":"https://Require.predictiveecology.org/reference/masterMainToHead.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This converts master or main to HEAD for a git repo — masterMainToHead","text":"gitRepo git repository form account/repo optional @branch @sha @tag","code":""},{"path":"https://Require.predictiveecology.org/reference/masterMainToHead.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"This converts master or main to HEAD for a git repo — masterMainToHead","text":"git repository @HEAD @master, @main @.","code":""},{"path":"https://Require.predictiveecology.org/reference/messageVerbose.html","id":null,"dir":"Reference","previous_headings":"","what":"Use message to print a clean square data structure — messageDF","title":"Use message to print a clean square data structure — messageDF","text":"Sends message, structured way data.frame-like can cleanly sent messaging. show message value verbose greater verboseLevel. mostly useful developers code want give users code easy access verbose code . developer function place messageVerbose internally, setting verboseLevel according advanced may want message . 1 reasonable default standard use, 0 \"important message users\", 2 increasing levels details e.g., advanced use. user sets -1 numeric approach, can avoid messaging.","code":""},{"path":"https://Require.predictiveecology.org/reference/messageVerbose.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Use message to print a clean square data structure — messageDF","text":"","code":"messageDF(df, round, verbose = getOption(\"Require.verbose\"), verboseLevel = 1) messageVerbose(..., verbose = getOption(\"Require.verbose\"), verboseLevel = 1) messageVerboseCounter( pre = \"\", post = \"\", verbose = getOption(\"Require.verbose\"), verboseLevel = 1, counter = 1, total = 1, minCounter = 1 )"},{"path":"https://Require.predictiveecology.org/reference/messageVerbose.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Use message to print a clean square data structure — messageDF","text":"df data.frame, data.table, matrix round optional numeric pass round verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility). verboseLevel numeric indicating verbose threshold (level) message show. ... Passed install.packages. Good candidates e.g., type dependencies. can used install_githubArgs install.packageArgs give individual options 2 internal function calls. pre single text string paste counter post single text string paste counter counter integer indicating iteration done total integer indicating total number done. minCounter integer indicating minimum (.e,. starting value)","code":""},{"path":"https://Require.predictiveecology.org/reference/messageVerbose.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Use message to print a clean square data structure — messageDF","text":"Used side effects, namely messaging can turned different numeric values verboseLevel. user sets verboseLevel particular message.","code":""},{"path":"https://Require.predictiveecology.org/reference/modifyList2.html","id":null,"dir":"Reference","previous_headings":"","what":"modifyList for multiple lists — modifyList2","title":"modifyList for multiple lists — modifyList2","text":"calls utils::modifyList iteratively using base::Reduce, can handle >2 lists. subsequent list elements share name override previous list elements name. also handle case list NULL. Note: default keep.null = TRUE, different modifyList","code":""},{"path":"https://Require.predictiveecology.org/reference/modifyList2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"modifyList for multiple lists — modifyList2","text":"","code":"modifyList2(..., keep.null = FALSE) modifyList3(..., keep.null = TRUE)"},{"path":"https://Require.predictiveecology.org/reference/modifyList2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"modifyList for multiple lists — modifyList2","text":"... One named lists. keep.null TRUE, NULL elements val become NULL elements x. Otherwise, corresponding element, present, deleted x.","code":""},{"path":"https://Require.predictiveecology.org/reference/modifyList2.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"modifyList for multiple lists — modifyList2","text":"less convenience around Reduce(modifyList, list(...)), checks, addition keep.null = TRUE default.","code":""},{"path":"https://Require.predictiveecology.org/reference/modifyList2.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"modifyList for multiple lists — modifyList2","text":"modifyList3 retains original behaviour modifyList2 (prior Oct 2022); however, retain NULL values lists.","code":""},{"path":"https://Require.predictiveecology.org/reference/modifyList2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"modifyList for multiple lists — modifyList2","text":"","code":"modifyList2(list(a = 1), list(a = 2, b = 2)) #> $a #> [1] 2 #> #> $b #> [1] 2 #> modifyList2(list(a = 1), NULL, list(a = 2, b = 2)) #> $a #> [1] 2 #> #> $b #> [1] 2 #> modifyList2( list(a = 1), list(x = NULL), list(a = 2, b = 2), list(a = 3, c = list(1:10)) ) #> $a #> [1] 3 #> #> $b #> [1] 2 #> #> $c #> $c[[1]] #> [1] 1 2 3 4 5 6 7 8 9 10 #> #>"},{"path":"https://Require.predictiveecology.org/reference/normPath.html","id":null,"dir":"Reference","previous_headings":"","what":"Normalize filepath — normPath","title":"Normalize filepath — normPath","text":"Checks specified filepath formatting consistencies: use slash instead backslash; tilde etc. expansion; remove trailing slash.","code":""},{"path":"https://Require.predictiveecology.org/reference/normPath.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Normalize filepath — normPath","text":"","code":"normPath(path) # S4 method for class 'character' normPath(path) # S4 method for class 'list' normPath(path) # S4 method for class 'NULL' normPath(path) # S4 method for class 'missing' normPath() # S4 method for class 'logical' normPath(path)"},{"path":"https://Require.predictiveecology.org/reference/normPath.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Normalize filepath — normPath","text":"path character vector filepaths.","code":""},{"path":"https://Require.predictiveecology.org/reference/normPath.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Normalize filepath — normPath","text":"Character vector cleaned filepaths.","code":""},{"path":"https://Require.predictiveecology.org/reference/normPath.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Normalize filepath — normPath","text":"","code":"## normalize file paths paths <- list(\"./aaa/zzz\", \"./aaa/zzz/\", \".//aaa//zzz\", \".//aaa//zzz/\", \".\\\\\\\\aaa\\\\\\\\zzz\", \".\\\\\\\\aaa\\\\\\\\zzz\\\\\\\\\", file.path(\".\", \"aaa\", \"zzz\")) checked <- normPath(paths) length(unique(checked)) ## 1; all of the above are equivalent #> [1] 3 ## check to see if a path exists tmpdir <- file.path(tempdir(), \"example_checkPath\") dir.exists(tmpdir) ## FALSE #> [1] FALSE tryCatch(checkPath(tmpdir, create = FALSE), error = function(e) FALSE) ## FALSE #> [1] FALSE checkPath(tmpdir, create = TRUE) #> [1] \"/tmp/RtmpbnaRVg/example_checkPath\" dir.exists(tmpdir) ## TRUE #> [1] TRUE unlink(tmpdir, recursive = TRUE) # clean up"},{"path":"https://Require.predictiveecology.org/reference/paddedFloatToChar.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert numeric to character with padding — paddedFloatToChar","title":"Convert numeric to character with padding — paddedFloatToChar","text":"pad floating point numbers, right left. integers, either class integer functionally integer (e.g., 1.0), pad right decimal. specific control get exact padding right left decimal, try stringi package. also rounding. See examples.","code":""},{"path":"https://Require.predictiveecology.org/reference/paddedFloatToChar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert numeric to character with padding — paddedFloatToChar","text":"","code":"paddedFloatToChar(x, padL = ceiling(log10(x + 1)), padR = 3, pad = \"0\")"},{"path":"https://Require.predictiveecology.org/reference/paddedFloatToChar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert numeric to character with padding — paddedFloatToChar","text":"x numeric. Number converted character padding padL numeric. Desired number digits left side decimal. enough, pad used pad. padR numeric. Desired number digits right side decimal. enough, pad used pad. pad character use padding (nchar(pad) == 1 must TRUE). Currently, can \"0\" \" \" (.e., space).","code":""},{"path":"https://Require.predictiveecology.org/reference/paddedFloatToChar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert numeric to character with padding — paddedFloatToChar","text":"Character string representing filename.","code":""},{"path":"https://Require.predictiveecology.org/reference/paddedFloatToChar.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Convert numeric to character with padding — paddedFloatToChar","text":"Eliot McIntire Alex Chubaty","code":""},{"path":"https://Require.predictiveecology.org/reference/paddedFloatToChar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert numeric to character with padding — paddedFloatToChar","text":"","code":"paddedFloatToChar(1.25) #> [1] \"1.250\" paddedFloatToChar(1.25, padL = 3, padR = 5) #> [1] \"001.25000\" paddedFloatToChar(1.25, padL = 3, padR = 1) # no rounding, so keeps 2 right of decimal #> [1] \"001.25\""},{"path":"https://Require.predictiveecology.org/reference/pakEnv.html","id":null,"dir":"Reference","previous_headings":"","what":"2nd level — pakEnv","title":"2nd level — pakEnv","text":"2nd level","code":""},{"path":"https://Require.predictiveecology.org/reference/pakEnv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"2nd level — pakEnv","text":"","code":"pakEnv()"},{"path":"https://Require.predictiveecology.org/reference/pkgDep.html","id":null,"dir":"Reference","previous_headings":"","what":"Reverse package depends — pkgDepTopoSort","title":"Reverse package depends — pkgDepTopoSort","text":"wrapper around tools::dependsOnPkgs, added option topoSort, sort packages top least number dependencies pkgs. essentially topological sort, done heuristically. can used e.g., detach unloadNamespace packages order dependencies detached unloaded first. pkgDep2 convenience wrapper pkgDep \"goes one level \", .e., first order dependencies, runs pkgDep . first look local filesystem (.libPaths()) use local package find dependencies. package exist locally, including whether correct version, look (currently) CRAN archives (current CRAN version desired version check). also look GitHub package description form GitHub package format account/repo@branch account/repo@commit. , attempt get package dependencies GitHub DESCRIPTION file. intended replace tools::package_dependencies pkgDep miniCRAN package, modifications allow multiple sources searched function call.","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgDep.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reverse package depends — pkgDepTopoSort","text":"","code":"pkgDepTopoSort( pkgs, deps, reverse = FALSE, topoSort = TRUE, libPaths, useAllInSearch = FALSE, returnFull = TRUE, recursive = TRUE, purge = getOption(\"Require.purge\", FALSE), which = c(\"Depends\", \"Imports\", \"LinkingTo\"), type = getOption(\"pkgType\"), verbose = getOption(\"Require.verbose\"), ... ) pkgDep2(...) pkgDep( packages, libPaths, which = c(\"Depends\", \"Imports\", \"LinkingTo\"), recursive = TRUE, depends, imports, suggests, linkingTo, repos = getOption(\"repos\"), keepVersionNumber = TRUE, includeBase = FALSE, includeSelf = TRUE, sort = TRUE, simplify = TRUE, purge = getOption(\"Require.purge\", FALSE), verbose = getOption(\"Require.verbose\"), type = getOption(\"pkgType\"), Additional_repositories = FALSE, ... )"},{"path":"https://Require.predictiveecology.org/reference/pkgDep.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reverse package depends — pkgDepTopoSort","text":"pkgs vector package names evaluate reverse depends (.e., packages use packages) deps optional named list (reverse) dependencies. supplied, tools::dependsOnPkgs(..., recursive = TRUE) used reverse Logical. TRUE, use tools::pkgDependsOn determine packages depend pkgs topoSort Logical. TRUE, default, returned list packages order least number dependencies listed pkgs top list. libPaths path search installed packages. Defaults .libPaths() useAllInSearch Logical. TRUE, non-core R packages search() appended pkgs allow also identified returnFull Logical. Primarily useful reverse = TRUE. TRUE, installed packages searched. FALSE, default, packages currently search() path passed pkgs included possible reverse dependencies. recursive Logical. dependencies dependencies searched, recursively. NOTE: Dependencies suggests recursive. Default TRUE. purge Logical. caches purged? Default getOption(\"Require.purge\", FALSE). lot internal caching results throughout Require package. help speed reduce calls internet sources. However, sometimes caches must purged. cached values renewed found old, age limit. maximum age can set seconds environment variable R_AVAILABLE_PACKAGES_CACHE_CONTROL_MAX_AGE, unset, defaults 3600 (one hour – see utils::available.packages). Internally, calls available.packages. character vector listing types dependencies, subset c(\"Depends\", \"Imports\", \"LinkingTo\", \"Suggests\", \"Enhances\"). Character string \"\" shorthand vector, character string \"\" vector without \"Enhances\". type See utils::install.packages verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility). ... Currently dependencies alternative . specified, ignored. packages Either character vector packages install via install.packages, load (.e., library), , convenience, vector list (using c list) unquoted package names install /load (require, vectorized). Passing vectors names may work cases, user confirm relying behaviour operational code. case GitHub package, assumed name repository name package. case, pass named character vector , names package names different GitHub repository name. depends Logical. Include packages listed \"Depends\". Default TRUE. imports Logical. Include packages listed \"Imports\". Default TRUE. suggests Logical. Include packages listed \"Suggests\". Default FALSE. linkingTo Logical. Include packages listed \"LinkingTo\". Default TRUE. repos remote repository (e.g., CRAN mirror), passed either install.packages, install_github installVersions. keepVersionNumber Logical. TRUE, package dependencies returned include version number. Default FALSE includeBase Logical. R base packages included, specifically, tail(.libPaths(), 1) includeSelf Logical. TRUE, default, dependencies include package returned list elements, otherwise, \"dependencies\" sort Logical. TRUE, default, packages sorted alphabetically. FALSE, packages discernible order concatenation possibly recursive package dependencies. simplify Logical numeric. TRUE (> 0), default, return object \"just\" character vector package names (version requirements). FALSE (0), data.table returned 4 columns, Package, packageFullName, parentPackage (package name given line entry dependency; \"user\" user supplied) deps, list data.tables dependencies. negative number, return similar data.table FALSE, however, duplications recursive package dependencies left intact. Additional_repositories Logical. TRUE, pkgDep return list data.table objects (instead character vectors) column packageFullName possibly second column Additional_repositories, may specified DESCRIPTION file. NOTE: ALTERS OUTPUT CLASS","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgDep.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reverse package depends — pkgDepTopoSort","text":"possibly ordered, named (packages names) list list elements either full reverse depends.","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgDep.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Reverse package depends — pkgDepTopoSort","text":"tools::package_dependencies pkgDep differ following circumstances: GitHub packages detected using tools::package_dependencies; tools::package_dependencies detect dependencies base packages among , e.g., methods depends stats graphics.","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgDep.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reverse package depends — pkgDepTopoSort","text":"","code":"if (FALSE) { # \\dontrun{ if (Require:::.runLongExamples()) { opts <- Require:::.setupExample() pkgDepTopoSort(c(\"Require\", \"data.table\"), reverse = TRUE) Require:::.cleanup(opts) } } # } if (FALSE) { # \\dontrun{ if (Require:::.runLongExamples()) { opts <- Require:::.setupExample() pkgDep2(\"reproducible\") # much bigger one pkgDep2(\"tidyverse\") Require:::.cleanup(opts) } } # } if (FALSE) { # \\dontrun{ if (Require:::.runLongExamples()) { opts <- Require:::.setupExample() pkgDep(\"tidyverse\", recursive = TRUE) # GitHub, local, and CRAN packages pkgDep(c(\"PredictiveEcology/reproducible\", \"Require\", \"plyr\")) Require:::.cleanup(opts) } } # }"},{"path":"https://Require.predictiveecology.org/reference/pkgDepEnv.html","id":null,"dir":"Reference","previous_headings":"","what":"2nd level — pkgDepEnv","title":"2nd level — pkgDepEnv","text":"2nd level","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgDepEnv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"2nd level — pkgDepEnv","text":"","code":"pkgDepEnv()"},{"path":"https://Require.predictiveecology.org/reference/pkgDepIfDepRemoved.html","id":null,"dir":"Reference","previous_headings":"","what":"Package dependencies when one or more packages removed — pkgDepIfDepRemoved","title":"Package dependencies when one or more packages removed — pkgDepIfDepRemoved","text":"primarily package developers. allows testing recursive dependencies package removed immediate dependencies.","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgDepIfDepRemoved.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Package dependencies when one or more packages removed — pkgDepIfDepRemoved","text":"","code":"pkgDepIfDepRemoved( pkg = character(), depsRemoved = character(), verbose = getOption() )"},{"path":"https://Require.predictiveecology.org/reference/pkgDepIfDepRemoved.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Package dependencies when one or more packages removed — pkgDepIfDepRemoved","text":"pkg package name testing dependencies depsRemoved vector package names \"removed\" pkg immediate dependencies verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgDepIfDepRemoved.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Package dependencies when one or more packages removed — pkgDepIfDepRemoved","text":"list 3 named lists Direct, Recursive IfRemoved. Direct show top level direct dependencies, either Remaining Removed. Recursive show full recursive dependencies, either Remaining Removed. IfRemoved returns package dependencies removed top level dependency. top level dependency listed final list, means also recursive dependency elsewhere, removal effect.","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgDepIfDepRemoved.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Package dependencies when one or more packages removed — pkgDepIfDepRemoved","text":"","code":"if (FALSE) { # \\dontrun{ if (Require:::.runLongExamples()) { opts <- Require:::.setupExample() pkgDepIfDepRemoved(\"reproducible\", \"data.table\") Require:::.cleanup(opts) } } # }"},{"path":"https://Require.predictiveecology.org/reference/pkgSnapshot.html","id":null,"dir":"Reference","previous_headings":"","what":"Take a snapshot of all the packages and version numbers — pkgSnapshot","title":"Take a snapshot of all the packages and version numbers — pkgSnapshot","text":"can used later Require install re-install correct versions. See examples.","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgSnapshot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Take a snapshot of all the packages and version numbers — pkgSnapshot","text":"","code":"pkgSnapshot( packageVersionFile = getOption(\"Require.packageVersionFile\"), libPaths = .libPaths(), standAlone = FALSE, purge = getOption(\"Require.purge\", FALSE), exact = TRUE, includeBase = FALSE, verbose = getOption(\"Require.verbose\") ) pkgSnapshot2( packageVersionFile = getOption(\"Require.packageVersionFile\"), libPaths, standAlone = FALSE, purge = getOption(\"Require.purge\", FALSE), exact = TRUE, includeBase = FALSE, verbose = getOption(\"Require.verbose\") )"},{"path":"https://Require.predictiveecology.org/reference/pkgSnapshot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Take a snapshot of all the packages and version numbers — pkgSnapshot","text":"packageVersionFile filename save packages currently installed version numbers. Defaults \"packageVersions.txt\". specified NULL, function return exact Require call needed install packages current versions. can useful add script allow reproducibility script. libPaths path local library packages installed. Defaults .libPaths()[1]. standAlone Logical. TRUE, packages installed loaded libPaths . NOTE: TRUE, CHANGE USER'S .libPaths(), similar e.g., checkpoint package. FALSE, libPath prepended .libPaths() Require call, resulting shared packages, .e., include user's default package folder(s). can create dramatically faster installs user substantial number packages already personal library. Default FALSE minimize package installing. purge Logical. caches purged? Default getOption(\"Require.purge\", FALSE). lot internal caching results throughout Require package. help speed reduce calls internet sources. However, sometimes caches must purged. cached values renewed found old, age limit. maximum age can set seconds environment variable R_AVAILABLE_PACKAGES_CACHE_CONTROL_MAX_AGE, unset, defaults 3600 (one hour – see utils::available.packages). Internally, calls available.packages. exact Logical. TRUE, default, GitHub packages, install exact SHA, rather head account/repo@branch. CRAN packages, install exact version. FALSE, GitHub packages identify branch specified upon installation, SHA. package installed reference SHA, return SHA know branch came . Similarly, CRAN packages report version specify >=, allowing subsequent user install minimum version number, opposed exact version number. includeBase Logical. R base packages included, specifically, tail(.libPaths(), 1) verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgSnapshot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Take a snapshot of all the packages and version numbers — pkgSnapshot","text":"write file, (invisibly) return vector packages version numbers. vector can used directly Require, though likely used require = FALSE prevent attaching packages.","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgSnapshot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Take a snapshot of all the packages and version numbers — pkgSnapshot","text":"file written package names versions packages within libPaths. can later passed Require. pkgSnapshot2 returns vector package names versions, file output. See examples.","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgSnapshot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Take a snapshot of all the packages and version numbers — pkgSnapshot","text":"","code":"if (FALSE) { # \\dontrun{ if (Require:::.runLongExamples()) { opts <- Require:::.setupExample() # install one archived version so that below does something interesting libForThisEx <- tempdir2(\"Example\") Require(\"crayon (==1.5.1)\", libPaths = libForThisEx, require = FALSE) # Normal use -- using the libForThisEx for example; # normally libPaths would be omitted to get all # packages in user or project library tf <- tempfile() # writes to getOption(\"Require.packageVersionFile\") # within project; also returns a vector # of packages with version pkgs <- pkgSnapshot( packageVersionFile = tf, libPaths = libForThisEx, standAlone = TRUE # only this library ) # Now move this file to another computer e.g. by committing in git, # emailing, googledrive # on next computer/project Require(packageVersionFile = tf, libPaths = libForThisEx) # Using pkgSnapshot2 to get the vector of packages and versions pkgs <- pkgSnapshot2( libPaths = libForThisEx, standAlone = TRUE ) Install(pkgs) # will install packages from previous line Require:::.cleanup(opts) unlink(getOption(\"Require.packageVersionFile\")) } } # }"},{"path":"https://Require.predictiveecology.org/reference/rmBase.html","id":null,"dir":"Reference","previous_headings":"","what":"Recursive function to remove .basePkgs — rmBase","title":"Recursive function to remove .basePkgs — rmBase","text":"Recursive function remove .basePkgs","code":""},{"path":"https://Require.predictiveecology.org/reference/rmBase.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Recursive function to remove .basePkgs — rmBase","text":"","code":"rmBase(includeBase = formals(pkgDep)[[\"includeBase\"]], deps)"},{"path":"https://Require.predictiveecology.org/reference/rmBase.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Recursive function to remove .basePkgs — rmBase","text":"includeBase Logical. FALSE, default, base packages removed. deps Either list dependencies, data.table dependencies column Package vector dependencies.","code":""},{"path":"https://Require.predictiveecology.org/reference/rversions.html","id":null,"dir":"Reference","previous_headings":"","what":"R versions — rversions","title":"R versions — rversions","text":"Reference table R versions release dates (2018 later).","code":""},{"path":"https://Require.predictiveecology.org/reference/rversions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"R versions — rversions","text":"","code":"rversions"},{"path":"https://Require.predictiveecology.org/reference/rversions.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"R versions — rversions","text":"object class data.frame 21 rows 2 columns.","code":""},{"path":"https://Require.predictiveecology.org/reference/rversions.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"R versions — rversions","text":"Update needed using rversions::r_versions(): # install.packages(\"rversions\") v = rversions::r_versions() keep = (.Date(v$date, format = \" .Date(\"2018-01-01\", format = \" dput(v[keep, c(\"version\", \"date\")])","code":""},{"path":"https://Require.predictiveecology.org/reference/setLibPaths.html","id":null,"dir":"Reference","previous_headings":"","what":"Set .libPaths — setLibPaths","title":"Set .libPaths — setLibPaths","text":"set .libPaths() either adding new path standAlone = FALSE, concatenate c(libPath, tail(.libPaths(), 1)) standAlone = TRUE. Currently, default make new .libPaths() \"sticky\", meaning becomes associated current directory even restart R. adding /updating .Rprofile file current directory. current directory project, project new .libPaths() associated , even R restart.","code":""},{"path":"https://Require.predictiveecology.org/reference/setLibPaths.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set .libPaths — setLibPaths","text":"","code":"setLibPaths( libPaths, standAlone = TRUE, updateRprofile = getOption(\"Require.updateRprofile\", FALSE), exact = FALSE, verbose = getOption(\"Require.verbose\") )"},{"path":"https://Require.predictiveecology.org/reference/setLibPaths.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set .libPaths — setLibPaths","text":"libPaths new path append , replace existing user components .libPath() standAlone Logical. TRUE, packages installed loaded libPaths . NOTE: TRUE, CHANGE USER'S .libPaths(), similar e.g., checkpoint package. FALSE, libPath prepended .libPaths() Require call, resulting shared packages, .e., include user's default package folder(s). can create dramatically faster installs user substantial number packages already personal library. Default FALSE minimize package installing. updateRprofile Logical Character string. TRUE, function put several lines code current directory's .Rprofile file setting package libraries future sessions. character string, path .Rprofile file. reset back normal, run setLibPaths() without libPath. Default: getOption(\"Require.updateRprofile\", FALSE), meaning FALSE, can set option within single call. exact Logical. function automatically append R version number libPaths maintain separate R package libraries R version system. cases behaviour desirable. Set exact TRUE override automatic appending use exact, unaltered libPaths. Default FALSE verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/setLibPaths.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set .libPaths — setLibPaths","text":"main point function set .libPaths(), changed side effect function. setting options, return previous state .libPaths() allowing user reset easily.","code":""},{"path":"https://Require.predictiveecology.org/reference/setLibPaths.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set .libPaths — setLibPaths","text":"details code modified https://github.com/milesmcbain. different, likely non-approved CRAN approach also works : https://stackoverflow.com//36873741/3890027.","code":""},{"path":"https://Require.predictiveecology.org/reference/setLibPaths.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set .libPaths — setLibPaths","text":"","code":"if (FALSE) { # \\dontrun{ if (Require:::.runLongExamples()) { opts <- Require:::.setupExample() origDir <- setwd(tempdir()) td <- tempdir() setLibPaths(td) # set a new R package library locally setLibPaths() # reset it to original setwd(origDir) # Using standAlone = FALSE means that newly installed packages # will be installed # in the new package library, but loading packages can come # from any of the ones listed in .libPaths() # will have 2 or more paths otherLib <- file.path(td, \"newProjectLib\") setLibPaths(otherLib, standAlone = FALSE) # Can restart R, and changes will stay # remove the custom .libPaths() setLibPaths() # reset to previous; remove from .Rprofile # because libPath arg is empty Require:::.cleanup(opts) unlink(otherLib, recursive = TRUE) } } # }"},{"path":"https://Require.predictiveecology.org/reference/setLinuxBinaryRepo.html","id":null,"dir":"Reference","previous_headings":"","what":"Setup for binary Linux repositories — setLinuxBinaryRepo","title":"Setup for binary Linux repositories — setLinuxBinaryRepo","text":"Enable use binary package builds Linux RStudio Package Manager repo. set repos option, affecting current R session. put binaryLinux first position. getOption(\"repos\") NULL, put backupCRAN second position.","code":""},{"path":"https://Require.predictiveecology.org/reference/setLinuxBinaryRepo.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Setup for binary Linux repositories — setLinuxBinaryRepo","text":"","code":"setLinuxBinaryRepo( binaryLinux = urlForArchivedPkgs, backupCRAN = srcPackageURLOnCRAN )"},{"path":"https://Require.predictiveecology.org/reference/setLinuxBinaryRepo.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Setup for binary Linux repositories — setLinuxBinaryRepo","text":"binaryLinux CRAN repository serving binary Linux packages. backupCRAN CRAN repository set","code":""},{"path":"https://Require.predictiveecology.org/reference/setdiffNamed.html","id":null,"dir":"Reference","previous_headings":"","what":"Like setdiff, but takes into account names — setdiffNamed","title":"Like setdiff, but takes into account names — setdiffNamed","text":"identify elements l1 l2. missingFill provided, elements l2, l1 returned, assigning missingFill values. might NULL \"\", .e., sort empty value. function work named lists, named vectors likely named classes.","code":""},{"path":"https://Require.predictiveecology.org/reference/setdiffNamed.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Like setdiff, but takes into account names — setdiffNamed","text":"","code":"setdiffNamed(l1, l2, missingFill)"},{"path":"https://Require.predictiveecology.org/reference/setdiffNamed.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Like setdiff, but takes into account names — setdiffNamed","text":"l1 named list named vector l2 named list named vector (must class l1) missingFill value, NULL \"\" \"missing\" given elements returned, l2, l1","code":""},{"path":"https://Require.predictiveecology.org/reference/setdiffNamed.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Like setdiff, but takes into account names — setdiffNamed","text":"vector list elements l1 l2, optionally elements l2 l1, values set missingFill","code":""},{"path":"https://Require.predictiveecology.org/reference/setdiffNamed.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Like setdiff, but takes into account names — setdiffNamed","text":"3 types differences might occur named elements: 1. new named element, 2. removed named element, 3. modified named element. function captures . case unnamed elements, e.g., setdiff, first two seen differences, values different.","code":""},{"path":"https://Require.predictiveecology.org/reference/setup.html","id":null,"dir":"Reference","previous_headings":"","what":"Setup a project library, cache, options — setup","title":"Setup a project library, cache, options — setup","text":"setup setupOff currently deprecated. may re-created future version. place, user can simply put .libPaths(libs, include.site = FALSE) .Rprofile file, libs directory packages installed folder R version number, e.g., derived using checkLibPaths(libs).","code":""},{"path":"https://Require.predictiveecology.org/reference/setup.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Setup a project library, cache, options — setup","text":"","code":"setup( newLibPaths, RPackageFolders, RPackageCache = cacheGetOptionCachePkgDir(), standAlone = getOption(\"Require.standAlone\", TRUE), verbose = getOption(\"Require.verbose\") ) setupOff(removePackages = FALSE, verbose = getOption(\"Require.verbose\"))"},{"path":"https://Require.predictiveecology.org/reference/setup.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Setup a project library, cache, options — setup","text":"newLibPaths RPackageFolders. consistent naming Require(..., libPaths = ...). RPackageFolders One folders R packages installed loaded . case one folder provided, installation happen first one. RPackageCache See ?RequireOptions. standAlone Logical. TRUE, packages installed loaded libPaths . NOTE: TRUE, CHANGE USER'S .libPaths(), similar e.g., checkpoint package. FALSE, libPath prepended .libPaths() Require call, resulting shared packages, .e., include user's default package folder(s). can create dramatically faster installs user substantial number packages already personal library. Default FALSE minimize package installing. verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility). removePackages Deprecated. Please remove packages manually .libPaths()","code":""},{"path":"https://Require.predictiveecology.org/reference/sourcePkgs.html","id":null,"dir":"Reference","previous_headings":"","what":"A list of R packages that should likely be installed from Source, not Binary — sourcePkgs","title":"A list of R packages that should likely be installed from Source, not Binary — sourcePkgs","text":"list R packages Require installs source Linux, even getOptions(\"repos\") binary repository. list can updated user modifying options Require.spatialPkgs Require.otherPkgs. Default \"force source packages\" visible RequireOptions().","code":""},{"path":"https://Require.predictiveecology.org/reference/sourcePkgs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A list of R packages that should likely be installed from Source, not Binary — sourcePkgs","text":"","code":"sourcePkgs(additional = NULL, spatialPkgs = NULL, otherPkgs = NULL)"},{"path":"https://Require.predictiveecology.org/reference/sourcePkgs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A list of R packages that should likely be installed from Source, not Binary — sourcePkgs","text":"additional packages added 2 argument vectors spatialPkgs character vector package names focus spatial analyses. otherPkgs character vector package names often require system specific compilation.","code":""},{"path":"https://Require.predictiveecology.org/reference/sourcePkgs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"A list of R packages that should likely be installed from Source, not Binary — sourcePkgs","text":"sorted concatenation 3 input parameters.","code":""},{"path":"https://Require.predictiveecology.org/reference/splitKeepOrderAndDTIntegrity.html","id":null,"dir":"Reference","previous_headings":"","what":"split for a data.table that keeps integrity of a column of lists of data.table objects — splitKeepOrderAndDTIntegrity","title":"split for a data.table that keeps integrity of a column of lists of data.table objects — splitKeepOrderAndDTIntegrity","text":"data.table::split 2 bad things: reorders using f destroys integrity column list data.tables, using , keep order, need , keep integrity, need f. function","code":""},{"path":"https://Require.predictiveecology.org/reference/splitKeepOrderAndDTIntegrity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"split for a data.table that keeps integrity of a column of lists of data.table objects — splitKeepOrderAndDTIntegrity","text":"","code":"splitKeepOrderAndDTIntegrity(pkgDT, splitOn)"},{"path":"https://Require.predictiveecology.org/reference/splitKeepOrderAndDTIntegrity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"split for a data.table that keeps integrity of a column of lists of data.table objects — splitKeepOrderAndDTIntegrity","text":"pkgDT pkgDT object e.g., toPkgDT splitOn Character vector passed data.table::split(..., f = splitOn)","code":""},{"path":"https://Require.predictiveecology.org/reference/splitKeepOrderAndDTIntegrity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"split for a data.table that keeps integrity of a column of lists of data.table objects — splitKeepOrderAndDTIntegrity","text":"list data.table objects length(unique(splitOn)).","code":""},{"path":"https://Require.predictiveecology.org/reference/sysInstallAndDownload.html","id":null,"dir":"Reference","previous_headings":"","what":"download.files or install.packages in a separate process — sysInstallAndDownload","title":"download.files or install.packages in a separate process — sysInstallAndDownload","text":"uses sys package messaging can controlled. also provides option parallelize spawning multiple background process allow parallel e.g., downloads. Noting libcurl installed (detected using capabilities(\"libcurl\")), explicit parallelism allowed, instead method = \"libcurl\" passed enabling parallel downloads.","code":""},{"path":"https://Require.predictiveecology.org/reference/sysInstallAndDownload.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"download.files or install.packages in a separate process — sysInstallAndDownload","text":"","code":"sysInstallAndDownload( args, splitOn = \"pkgs\", doLine = \"outfiles <- do.call(download.packages, args)\", returnOutfile = FALSE, doLineVectorized = TRUE, tmpdir, libPaths, verbose )"},{"path":"https://Require.predictiveecology.org/reference/sysInstallAndDownload.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"download.files or install.packages in a separate process — sysInstallAndDownload","text":"args list arguments .call either download.file, install.packagesor custom function e.g.,downloadAndBuildToLocalFile`. splitOn character vector names args parallelize . Defaults pkgs. named elements args assumed length 1 used every parallel process. doLine character string \"outfiles <- .call(..., args)\" line. returnOutfile logical. TRUE, names outfiles returned. doLineVectorized logical. TRUE, parallism used, indicates doLine function allows multiple elements args[[splitOn[[1]]]. FALSE, function make multiple sequential calls within parallel process doLine call. tmpdir single path downloads put libPaths library path (libraries) packages installed, looked load (.e., call library). can used create isolated, stand alone package installations, used standAlone = TRUE. Currently, path supplied prepended .libPaths() (temporarily call) Require standAlone = FALSE set (temporarily) .libPaths() c(libPaths, tail(libPaths(), 1) keep base packages. verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/sysInstallAndDownload.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"download.files or install.packages in a separate process — sysInstallAndDownload","text":"Mostly side effects, namely installed packages downloaded packages files. However, case returnOutfile = TRUE, list filenames returned outputs doLine.","code":""},{"path":"https://Require.predictiveecology.org/reference/tempdir2.html","id":null,"dir":"Reference","previous_headings":"","what":"Make a temporary (sub-)directory — tempdir2","title":"Make a temporary (sub-)directory — tempdir2","text":"Create temporary subdirectory .RequireTempPath(), temporary file temporary subdirectory.","code":""},{"path":"https://Require.predictiveecology.org/reference/tempdir2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make a temporary (sub-)directory — tempdir2","text":"","code":"tempdir2( sub = \"\", tempdir = getOption(\"Require.tempPath\", .RequireTempPath()), create = TRUE )"},{"path":"https://Require.predictiveecology.org/reference/tempdir2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make a temporary (sub-)directory — tempdir2","text":"sub Character string, length 1. Can result file.path(\"smth\", \"smth2\") nested temporary sub directories. tempdir Optional character string temporary dir placed. Defaults .RequireTempPath() create Logical. directory created. Default TRUE","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/reference/tempfile2.html","id":null,"dir":"Reference","previous_headings":"","what":"Make a temporary subfile in a temporary (sub-)directory — tempfile2","title":"Make a temporary subfile in a temporary (sub-)directory — tempfile2","text":"Make temporary subfile temporary (sub-)directory","code":""},{"path":"https://Require.predictiveecology.org/reference/tempfile2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make a temporary subfile in a temporary (sub-)directory — tempfile2","text":"","code":"tempfile2( sub = \"\", tempdir = getOption(\"Require.tempPath\", .RequireTempPath()), ... )"},{"path":"https://Require.predictiveecology.org/reference/tempfile2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make a temporary subfile in a temporary (sub-)directory — tempfile2","text":"sub Character string, length 1. Can result file.path(\"smth\", \"smth2\") nested temporary sub directories. tempdir Optional character string temporary dir placed. Defaults .RequireTempPath() ... passed tempfile, e.g., fileext","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/reference/trimVersionNumber.html","id":null,"dir":"Reference","previous_headings":"","what":"Trim version number off a compound package name — trimVersionNumber","title":"Trim version number off a compound package name — trimVersionNumber","text":"resulting string(s) name (including github.com repository exists).","code":""},{"path":"https://Require.predictiveecology.org/reference/trimVersionNumber.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Trim version number off a compound package name — trimVersionNumber","text":"","code":"trimVersionNumber(pkgs)"},{"path":"https://Require.predictiveecology.org/reference/trimVersionNumber.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Trim version number off a compound package name — trimVersionNumber","text":"pkgs character string vector packages without GitHub path versions","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/reference/trimVersionNumber.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Trim version number off a compound package name — trimVersionNumber","text":"","code":"trimVersionNumber(\"PredictiveEcology/Require (<=0.0.1)\") #> [1] \"PredictiveEcology/Require\""},{"path":"https://Require.predictiveecology.org/reference/updatePackages.html","id":null,"dir":"Reference","previous_headings":"","what":"Update installed packages with latest available versions — updatePackages","title":"Update installed packages with latest available versions — updatePackages","text":"Similar update.packages, works archived, non-archived, Github packages.","code":""},{"path":"https://Require.predictiveecology.org/reference/updatePackages.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update installed packages with latest available versions — updatePackages","text":"","code":"updatePackages( libPaths = .libPaths()[1], purge = FALSE, verbose = getOption(\"Require.verbose\") )"},{"path":"https://Require.predictiveecology.org/reference/updatePackages.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update installed packages with latest available versions — updatePackages","text":"libPaths library update; defaults .libPaths()[1] purge Logical. assessment installed.packages purge cached version. Default FALSE verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/updatePackages.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Update installed packages with latest available versions — updatePackages","text":"Run side effect, namely, updating installed packages latest possible state, whether CRAN currently, archived, GitHub.","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/news/index.html","id":"major-changes-1-0-0","dir":"Changelog","previous_headings":"","what":"major changes","title":"version 1.0.0","text":"Installation, package downloading, package building source now occur external process using sys package. allows control messaging installations, also allows installation many packages already loaded (message session need restarting). can turned turned option(Require.installPackagesSys = FALSE). internals pkgDep changed. new algorithms faster reliable, far fewer lines code. testing converted using testit using testthat. change adds many dependencies Suggests, benefits, e.g., using withr control loading unloading options, packages etc., outweigh drawbacks.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-1-0-0","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 1.0.0","text":"packages argument Require Install can now unquoted names length == 1 length > 1 using c() list(), addition character string, e.g., Install(ggplot2); Now, GitHub.com package field Additional_repositories DESCRIPTION file, Require search packages find repos argument. affect CRAN packages, information contained within available.packages() data base, used identify dependencies, rather reading DESCRIPTION file individually; verbose now propagates better internal functions, e.g., verbose = -2 make installing silent; Better automatic cleaning Cached packages corrupt; experimental use pak backend installer packages instead install.packages. user can attempt use backend options(Require.usePak = TRUE). number cases (specifically needing exact versions) work; “normal” package installations widely tested. pak backend tends similar speed first installations, much slower subsequent calls Install/Require; Better recovery installation failures e.g., local cached copy corrupt, automatically cleaned; Require.Rmd vignette “Getting Started” new; many speed enhancements cases e.g., download necessary; downloads GitHub.com done, Require now uses gitcreds get git credentials httr download files token;","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"function-name-changes-1-0-0","dir":"Changelog","previous_headings":"","what":"Function name changes","title":"version 1.0.0","text":"functions related cache now start cache, e.g., cacheClearPackages replaces clearRequirePackageCache. Previous names kept backwards compatibility.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfixes-1-0-0","dir":"Changelog","previous_headings":"","what":"bugfixes","title":"version 1.0.0","text":"GitHub packages attempted installed, failed package already loaded session, Require incorrectly think successfully installed (#87); Warning occurred package longer CRAN user supplied multiple repos getOption('repos'). result unaffected warning, warning now removed; allow user-specified path pkgSnapshot() (#93); number new cases added tests previously hit errors; many small bugs fixed; issues specific MacOS fixed. fixes implemented issues #91, #96, #97, #102, #105","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-031","dir":"Changelog","previous_headings":"","what":"version 0.3.1","title":"version 0.3.1","text":"CRAN release: 2023-05-22","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-0-3-1","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 0.3.1","text":"minor modifications internet available deal edge cases package snapshots internally consistent, .e., violate package versions, skip missing branches GitHub, needed (#81).","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfixes-0-3-1","dir":"Changelog","previous_headings":"","what":"bugfixes","title":"version 0.3.1","text":"updates tests begun fail","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-030","dir":"Changelog","previous_headings":"","what":"version 0.3.0","title":"version 0.3.0","text":"CRAN release: 2023-03-14","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-0-3-0","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 0.3.0","text":"Moved MRAN archives binaries https://packagemanager.posit.co/ move MRAN posit package manager, attempts made use archived binary packages Linux also. improved messaging several places improved error catching several places number cases annoying users identified addressed. setupOff setLibPaths enhanced fully functioning wide diversity cases. setting install = \"force\" Require, now user-specified packages forced installed; rest installed required, mimicking install.packages small efficiency gains many places (HEAD) now robust way keep package date.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"advanced-changes-0-3-0","dir":"Changelog","previous_headings":"","what":"advanced changes","title":"version 0.3.0","text":"several functions now exported, .downloadFileMasterMainAuth, messageVerbose, messageDF deemed useful enough packages.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfixes-0-3-0","dir":"Changelog","previous_headings":"","what":"bugfixes","title":"version 0.3.0","text":"slow assessment package dependencies CRAN packages stale available.packagesCached() object. Now, catches condition refreshes available.packages() corrected support multiple repos offer packages. Now works like install.packages, .e., first one first. base packages can now installed previous issues installing dealt .","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-026","dir":"Changelog","previous_headings":"","what":"version 0.2.6","title":"version 0.2.6","text":"CRAN release: 2023-01-05","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-0-2-6","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 0.2.6","text":"attempts deal cases failed installations Install install argument; now introduced, allowing (likely) use case Install(pkg, install = \"force\") examples now use Install often Require(..., require = FALSE) simplicity.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"improved-messaging-0-2-6","dir":"Changelog","previous_headings":"","what":"improved messaging","title":"version 0.2.6","text":"non-interactive CRAN mirror set, user gets informative error.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfixes-0-2-6","dir":"Changelog","previous_headings":"","what":"bugfixes","title":"version 0.2.6","text":"Cases multiple user-specified .libPaths() treated incorrectly; now respected. git repo installed identical SHA already installed, loaded, thinking failed install; fixed can now deal case repos multiple, non-binary CRAN-like repositories, also least one binary repository supplied e.g., rstudio package manager, .e., least 3 repositories supplied, 1 binary. minor","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-025","dir":"Changelog","previous_headings":"","what":"version 0.2.5","title":"version 0.2.5","text":"CRAN release: 2022-11-24","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-0-2-5","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 0.2.5","text":"several modifications enable CRAN-policy violations addressed, notably keeping temporary (package personal) cache directories clean examples tests major overhaul inner workings Require. now downloads builds Archive GitHub packages prior installation, installs packages (CRAN, Archive, GitHub, MRAN Windows) one install.packages call (Linux-alikes) two install.packages calls (binary source), allowing efficient parallel installs. results fast installs combinations packages. new options(\"Require.offlineMode\") can set FALSE stop Require pkgDep checking internet. fail, unless cached packages available locally (.e., run packages installed previously). , installed without needing internet. option also set automatically first attempt get file internet, fails, triggering test internet. fails, option set FALSE next call Require pkgDep reset. experimental still. many edge cases found dealt experimental use (HEAD) keep package “date” HEAD GitHub branch. behaviour still uses version numbering, update based SHA, HEAD ahead locally installed package (HEAD) specified, update. Specifically, use instead version number, e.g., \"PredictiveEcology/Require@development (HEAD)\" modifyList2 now follows modifyList adding keep.null argument. setdiffNamed compare 2 named lists vectors keep elements first list (vector), keeping mind name well element. package messaging sorted alphabetically installation message calls now messageVerbose, verbosity can fully controlled argument verbose options(\"Require.verbose\"). See ?RequireOptions. tests clean completely options(Require.cachePkgDir = FALSE) (environment variable \"R_REQUIRE_PKGCACHE\"), cache folder created; previously nearly empty folder created default. See ?RequireOptions Remove option Require.persistentPkgEnv deemed superfluous. numerous enhancements speed new function Install, Require(..., require = FALSE) (HEAD) now tested CRAN repositories works expected. Updated README show new functionality attempt use local cached packages crancache user sets options(Require.useCranCache = TRUE). experimental still tested. new function, clearRequirePackageCache, clearing package cache. cache developed able shared across Operating Systems, shared file system. GitHub packages require SHA assessed; now Cached disk well RAM, persists even R restart. non-package cache files (available.packages, pkgDep, GitHubSHA) refreshed (purged) every 1 hour. Much improved messaging, including identifying MRAN package installs explicitly (instead just “Archive”)","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfixes-0-2-5","dir":"Changelog","previous_headings":"","what":"bugfixes","title":"version 0.2.5","text":"pkgDep using local DESCRIPTION file establish package dependencies package, available. local package ahead CRAN (developer’s case), desirable. , local installed version behind CRAN (common user’s case), desirable. pkgDep now uses CRAN’s version (using available.packages) developers can handle situation . several minor bugfix defaultCacheDir, default runneradmin conditions allow installing packages due permissions.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"deprecated-0-2-5","dir":"Changelog","previous_headings":"","what":"deprecated","title":"version 0.2.5","text":"setup setupOff now deprecated; messaging supplied used several options deprecated","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-0-1-6","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 0.1.6","text":"pkgSnapshot examples brought present usage & simplified pkgSnapshot now uses default filename option Require.packageVersionFile. Require can now accept packageVersionFile = TRUE, meaning use package version file set Require.packageVersionFile option.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfix-0-1-6","dir":"Changelog","previous_headings":"","what":"bugfix","title":"version 0.1.6","text":"minor bugfix detected submission CRAN","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-0-1-5","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 0.1.5","text":"package caching packages need sources installs (.e., identified sourcePkgs(), tend occur R packages require idiosyncratic system dependencies) cache binary version reuse system subsequent re-installs.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfix-0-1-5","dir":"Changelog","previous_headings":"","what":"bugfix","title":"version 0.1.5","text":"pkgDep misidentifying correct package dependencies. manifest user version package “” installed well dependencies, e.g., “B”. user updated “” new version required new version “B”, correctly identify new dependency requirement, update “B”, causing “” update fail. fixed.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-014","dir":"Changelog","previous_headings":"","what":"version 0.1.4","title":"version 0.1.4","text":"CRAN release: 2022-10-07 Make corrections 2 failing architectures CRAN MUCH less verbose automated testing","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancement-0-1-4","dir":"Changelog","previous_headings":"","what":"enhancement","title":"version 0.1.4","text":"verbose argument now widespread, -1, 0, 1, 2 valid correctly inherited values. See argument description e.g., ?Require improved warning handling","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfixes-0-1-4","dir":"Changelog","previous_headings":"","what":"bugfixes","title":"version 0.1.4","text":"edge cases found dealt ","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-012","dir":"Changelog","previous_headings":"","what":"version 0.1.2","title":"version 0.1.2","text":"CRAN release: 2022-09-23","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"dependencies-0-1-2","dir":"Changelog","previous_headings":"","what":"dependencies","title":"version 0.1.2","text":"drop support R 3.6 (R >= 4.0 supported)","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-0-1-2","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 0.1.2","text":"Require argument, require, can now character string, indicating packages attached via require Now can use GITHUB_PAT environment variable, set, accesses GitHub.com repositories (files entire repository) Attempt capture correct cases GitHub.com branches incorrectly labelled master instead main (vice versa) much quieter messaging default (can increase verbose = 1) require argument Require can now character vector indicating packages attached, just installed. Note: default, packages passed packages attached require = TRUE much faster installations: source packages, grouped installed together using internal parallelism install.packages (setting Ncpus option 4) binary, passes vectors install.packages much faster. packages installed install-safe groups speed can use pak package hood options(“Require.usepak” = TRUE), though still many cases pak deal . Users try determine option delivers expected. pak installs tend slightly faster work correctly. binary package caching turned default user-specific standard directory, making repeat installations (system, shared drive systems) much faster. MRAN installs Windows now much robust many conditions. archived packages (ie longer CRAN) now found installed (latest available version) robust dependency identification even archived older packages package versions (including dependencies) MRAN binaries used MacOSX. improved installation older packages (e.g. dependencies removed CRAN, source versions can’t easily compiled) several minor improvements package dependency resolution installation.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfixes-0-1-2","dir":"Changelog","previous_headings":"","what":"bugfixes","title":"version 0.1.2","text":"fix issue ‘dot directories’ normPath(). identified possible bug install.packages options(Ncpus = XX) XX number > 1. packages skipped. Require now captures attempts install ones get correctly installed. multiple fixes certain edge cases.","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-0-1-1","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 0.1.1","text":"can now use pak options(\"Require.usepak\" = TRUE) version specifications (.e., user specifies e.g., Require(\"reproducible (<= 1.2.9)), non-pak approach used)","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfixes-0-1-1","dir":"Changelog","previous_headings":"","what":"bugfixes","title":"version 0.1.1","text":"fixed error installing certain GitHub packages","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-0-1-0","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 0.1.0","text":"install CRAN packages using vectorized install.packages –> much faster now uses internal installGithubPackage instead remotes::install_github previous means installations use install.packages directly remove dependency remotes","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfixes-0-1-0","dir":"Changelog","previous_headings":"","what":"bugfixes","title":"version 0.1.0","text":"Require silently fail install GitHub package warning installation. warnings now correctly captured, without stopping installation. bugfix package installed GitHub directly Remotes field package Suggests (DESCRIPTION file). install Remotes package even though Suggests bugfix user supplies non-CRAN repos argument Require. correctly using. Thanks @CeresBarros identifying issue #30 bugfix “packages appear installed correctly” misreporting cases. repos argument correctly passed doInstalls Require. meant installs respect user supplied repos, use options(\"repos\") instead. extractPkgNames now allows GitHub packages repository omitted, .e., @. useful default expectation github repository better handling GitHub package install issues","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-0013","dir":"Changelog","previous_headings":"","what":"version 0.0.13","title":"version 0.0.13","text":"CRAN release: 2021-05-31 fix CRAN policy violation – dealt extraneous folder created testing","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-0012","dir":"Changelog","previous_headings":"","what":"version 0.0.12","title":"version 0.0.12","text":"CRAN release: 2021-05-26","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"dependency-changes-0-0-12","dir":"Changelog","previous_headings":"","what":"Dependency changes","title":"version 0.0.12","text":"release R 4.1, dropped support R 3.5. R 3.6 (oldrel) newer supported.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"new-features-0-0-12","dir":"Changelog","previous_headings":"","what":"New features","title":"version 0.0.12","text":"setup: new function creating new project. See readme.md setLibPath package caching (via options(\"RPackageCache\")) now automatically create use subfolder user-provided path R major & minor version number (normal R behaviour) allow multiple R versions coexist machine. setLibPaths gains new argument, updateRprofile, allows user’s changes .libPaths() persist R restart. Set getOption(\"Require.updateRprofile\", FALSE), start","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bug-fixes-0-0-12","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"version 0.0.12","text":"several edge cases complex loading many packages incorrectly () loading base packages, e.g., parallel small minor bugfixes cases DESCRIPTION file package minimum version (e.g., Imports) REMOTES: package (without minimum version, branch, say), Require use REMOTES: entry. since means minimum package version, Require automatically install package violating minimum version number, install anything. Now, harmonizes 2 entries given package, uses minimum version number git branch potential source find version number. allow either master main branches installed GitHub, without needing specify (#26) fix use options setup()","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-0010","dir":"Changelog","previous_headings":"","what":"version 0.0.10","title":"version 0.0.10","text":"CRAN release: 2020-12-02","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bug-fixes-0-0-10","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"version 0.0.10","text":"CRAN error one flavour Linux erroneous checkPath error creating Specified path xxxx exist even though .","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-009","dir":"Changelog","previous_headings":"","what":"version 0.0.9","title":"version 0.0.9","text":"CRAN release: 2020-11-30","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"new-features-0-0-9","dir":"Changelog","previous_headings":"","what":"New features","title":"version 0.0.9","text":"modifyList2, generalization utils::modifyList >2 lists. Also, can handle NULL lists. slight improvements speed internal functions detachAll now unloads reverse depends depends, loaded","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bug-fixes-0-0-9","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"version 0.0.9","text":"deals cases installing arbitrary packages packageVersion.txt file mistakenly create new, empty directory packages accommodate 2 LibPaths packageVersion.txt file, second () LibPath full base packages. Handles better false positives (packages install properly ) false negatives (error collected end error installing) better suggestion edge cases failed package installs captures deals bug install.packages (argument \"av2\" missing, default) R-devel Windows (Sept 09, 2020). May transient. , default, installing source Windows. Fixed.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-008","dir":"Changelog","previous_headings":"","what":"version 0.0.8","title":"version 0.0.8","text":"CRAN release: 2020-09-10","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"new-features-0-0-8","dir":"Changelog","previous_headings":"","what":"New features","title":"version 0.0.8","text":"GitHub SHA now stored pkgSnapshot, meaning new system can built exact versions SHAs GitHub packages. GitHub packages, now uses DESCRIPTION NAMESPACE files determine dependencies. GitHub packages generally packages state development. may include missing declarations DESCRIPTION. NAMESPACE R uses actually determine package dependencies upon installation. Now keeps binary/source package locally options(\"Require.cachePkgDir\" = \"someLocalDir\") set local folder. Currently defaults NULL, meaning local cache. Require pkgSnapshot can now understand work GitHub SHAs thus packages installed GitHub, e.g., Require(\"PredictiveEcology/Require@development\") install development version. using pkgSnapshot, exact SHA used restore package exact version Require(packageVersionFile = \"packageVersions.txt\"). package already loaded prior changing running setLibPaths, possible create version conflict. base::require error version .libPaths() older version whose namespace already loaded. accommodate , check error, newer version (already loaded) violate Require('package (versionSpecification)'), install newer version. violate version specification, error cleanly message describing possible solutions. Much better messaging reporting New function: detachAll attempts detach unload packages dependencies, reverse topological order. Speed improvements, especially pkgDep pkgDepTopoSort New function pkgDepAlt alternative pkgDep, yet easier maintain still experimental. yet workhorse inside Require, may become . Now correctly removes spaces tab characters within package version description – creating error Error: invalid version specification ' 3.3-13'","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bug-fixes-0-0-8","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"version 0.0.8","text":"pkgDepTopoSort now appears correct types package descriptions currently allowed Require, namely, packages version specification, packages version specification (including older versions), GitHub packages. many minor edge cases","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-007","dir":"Changelog","previous_headings":"","what":"version 0.0.7","title":"version 0.0.7","text":"CRAN release: 2020-08-18","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"new-features-0-0-7","dir":"Changelog","previous_headings":"","what":"New features","title":"version 0.0.7","text":"longer sets CRAN repository cloud.r-project.org even non-interactive CRAN repository set. Now uses chooseCRANmirror(ind = 1)","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bug-fixes-0-0-7","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"version 0.0.7","text":"fixes CRAN check issues Fedora.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-006","dir":"Changelog","previous_headings":"","what":"version 0.0.6","title":"version 0.0.6","text":"CRAN release: 2020-08-11","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"new-features-0-0-6","dir":"Changelog","previous_headings":"","what":"New features","title":"version 0.0.6","text":"none","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bug-fixes-0-0-6","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"version 0.0.6","text":"fixed CRAN check issues. default repo now uses option repos instead specifying CRAN repo.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-005","dir":"Changelog","previous_headings":"","what":"version 0.0.5","title":"version 0.0.5","text":"CRAN release: 2020-07-17","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"new-features-0-0-5","dir":"Changelog","previous_headings":"","what":"New features","title":"version 0.0.5","text":"moved several functions package loading installing reproducible Require, including pkgDep, pkgDepTopoSort.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bug-fixes-0-0-5","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"version 0.0.5","text":"recursive pkgDep correctly resolve multiple instances package, different minimum version numbering. Now reports minimum version required package dependencies. minor changes non-exported functions handling bugs base::available.packages old Mac machines R versions","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-004","dir":"Changelog","previous_headings":"","what":"version 0.0.4","title":"version 0.0.4","text":"CRAN release: 2020-06-05","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bug-fixes-0-0-4","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"version 0.0.4","text":"remove installed.packages test code, per CRAN request","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-003","dir":"Changelog","previous_headings":"","what":"version 0.0.3","title":"version 0.0.3","text":"Change title Title Case DESCRIPTION","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-002","dir":"Changelog","previous_headings":"","what":"version 0.0.2","title":"version 0.0.2","text":"Change backticks single quotes DESCRIPTION","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/news/index.html","id":"new-features-0-0-1","dir":"Changelog","previous_headings":"","what":"New features","title":"version 0.0.1","text":"rewrite function, Require (helpers) removed package reproducible function intended tool package management used within “reproducible” workflow differs attempts achieving goal trait first subsequent times function Require run, result ","code":""}] +[{"path":"https://Require.predictiveecology.org/CONTRIBUTING.html","id":"report-a-bug","dir":"","previous_headings":"","what":"Report a bug","title":"NA","text":"Use issue tracker report bug. Please include minimum reproducible example triggers bug. Please include output devtools::session_info().","code":""},{"path":"https://Require.predictiveecology.org/CONTRIBUTING.html","id":"submit-an-enhancement","dir":"","previous_headings":"","what":"Submit an enhancement","title":"NA","text":"Git repository uses Git Flow branching model (git flow extension useful ). development branch contains latest contributions code appear next release, master branch contains code latest release, exactly currently CRAN. make contribution package, just send pull request. send PR, make sure development destination branch Require repository. PR pass R CMD check ---cran, also checked GitHub Actions PR submitted. ’ll try review pull request provide feedback / merge improvements quickly possible. Thank !","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"principles-used-in-require","dir":"Articles","previous_headings":"","what":"Principles used in Require","title":"The `Require` approach, comparing `pak` and `renv`","text":"Require designed features facilitate running R code part continuous reproducible workflow, data--decisions. work, functions called user property whereby initial time called heavy work, subsequent times sufficiently fast user forced skip lines code re-running code. called “rerun-tolerance”, .e., line can rerun identical conditions quickly return original result. package, reproducible, function Cache can convert many function calls property. work well functions whose objectives side-effects, like installing loading packages. Require fills gap.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"key-features","dir":"Articles","previous_headings":"Principles used in Require","what":"Key features","title":"The `Require` approach, comparing `pak` and `renv`","text":"Features include: Fast, parallel installs downloads. Installs CRAN CRAN-alike even archived.. Installs GitHub packages. User can specify version install using standard R-version approach (e.g., ==3.5.0 >=3.5.0). Local package caching cloning (see ) fast (re-)installs. Manages (types ) conflicting package requests, .e., different GitHub branches. options-level control packages installed source (see RequireOptions()) even downloaded binary repository. Finds specific versions packages incomplete CRAN-like repository (r-universe.dev), even version available, available main CRAN mirrors. Handles errors handled install.packages like “already use”.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"how-it-works","dir":"Articles","previous_headings":"Principles used in Require","what":"How it works","title":"The `Require` approach, comparing `pak` and `renv`","text":"Require uses install.packages internally install packages. However, let install.packages download packages. Rather, identifies dependencies recursively, finds (CRAN, GitHub, Archives, Local), downloads (gets local cache clones specified package library). libcurl available (assessed via capabilities(\"libcurl\")), download parallel CRAN-like repositories. sys installed, download GitHub packages parallel also. user set options(\"Ncpus\") manually, set value 8 parallel installs binary source packages.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"rerun-tolerance","dir":"Articles","previous_headings":"Principles used in Require","what":"Rerun-tolerance","title":"The `Require` approach, comparing `pak` and `renv`","text":"functionally reproducible, code must regularly run tested many operating systems computers. happen, user/developer know certain code chunks longer work try run later. words, code gets stale underlying algorithms data change. rerun-tolerant, function must: return result outcome every time run (first, second times later); fast first time; fast, users skip running “don’t need run slow” Require . See “fast”.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"why-these-features-help-teams","dir":"Articles","previous_headings":"Principles used in Require","what":"Why these features help teams","title":"The `Require` approach, comparing `pak` and `renv`","text":"common code development work teams, updating package code. beneficial whether team tight, working exactly project, looser share certain components across diverse projects.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"all-working-on-same-project","dir":"Articles","previous_headings":"Principles used in Require > Why these features help teams","what":"All working on same project","title":"The `Require` approach, comparing `pak` and `renv`","text":"whole team working “whole” project, may useful use “package snapshot” approach, used renv package. Require offers similar functionality function pkgSnapshot(). Using approach provides mechanism team member update code, snapshot project, commit snapshot push cloud team share.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"diverse-projects","dir":"Articles","previous_headings":"Principles used in Require > Why these features help teams","what":"Diverse projects","title":"The `Require` approach, comparing `pak` and `renv`","text":"However, team diversified actually sharing new code, whole project, project snapshots inefficient package management must package--package case, whole project. words, code developer can work package, various team members 2 options might want : keep bleeding edge update necessary dependencies. likely, want mixture strategies, .e., bleeding edge code, necessary others. Thus, Require offers programmatic control . example keep project bleeding edge development branch reproducible, update necessary (based version needed, expressed inequality) development branch SpaDES.core. user make decisions run time whether update made, packages.","code":"library(Require) Require::Install( c(\"PredictiveEcology/reproducible@development (HEAD)\", \"PredictiveEcology/SpaDES.core@development (>=2.0.5.9004)\"))"},{"path":[]},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"default-behaviours-different","dir":"Articles","previous_headings":"How Require differs from other approaches","what":"Default behaviours different","title":"The `Require` approach, comparing `pak` and `renv`","text":"packages yet installed: packages installed: packages already installed, latest CRAN:","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"differences-and-similarities-between-pak-and-require","dir":"Articles","previous_headings":"How Require differs from other approaches","what":"Differences and similarities between pak and Require","title":"The `Require` approach, comparing `pak` and `renv`","text":"table based Require v1.0.0 pak v0.7.2. * Indicates example .","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"archived-packages","dir":"Articles","previous_headings":"How Require differs from other approaches","what":"Archived packages","title":"The `Require` approach, comparing `pak` and `renv`","text":"mid March 2024 April 5, 2024, fastdigest taken CRAN. part direct dependencies, can remove find alternative. However, indirect dependency, don’t choice: workflow break. Require just get recent archived copy work can continue. fastdigest back CRAN, others , e.g., older knn package:","code":"Require::Install(\"knn\") try(pak::pkg_install(c(\"knn\")))"},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"dependency-conflict","dir":"Articles","previous_headings":"How Require differs from other approaches","what":"Dependency conflict","title":"The `Require` approach, comparing `pak` and `renv`","text":"code development, common use many GitHub packages. (dependencies) may point one branches, either directly user Remotes field. next example, pak errors, Require makes decisions installs. common occurrence teams developing packages concurrently. pak approach suggests prepending :: package(s) /causing conflict. may suffice situations. Require approach assume equivalent :: means prioritize base (order) 1. use package version requirements, 2. CRAN-like repositories, 3. order. following work pak BioSIM, dependency GitHub found. may package name repository name, clear error message :","code":"library(Require) # Fails because of a) packages taken off CRAN & multiple GitHub branches requested within the nested dependencies pkgs <- c(\"reproducible\", \"PredictiveEcology/SpaDES@development\") dirTmp <- tempdir2(sub = \"first\") .libPaths(dirTmp) install.packages(\"pak\") # need this in the library; can't use personal library version try(pak::pkg_install(pkgs)) # ✔ Loading metadata database ... done # Error : ! error in pak subprocess # Caused by error: # ! Could not solve package dependencies: # * reproducible: dependency conflict # * PredictiveEcology/SpaDES@development: Can't install dependency PredictiveEcology/reproducible@development (>= 2.0.10) # * PredictiveEcology/reproducible@development: Conflicts with reproducible pkgsAny <- c(\"any::reproducible\", \"PredictiveEcology/SpaDES@development\") try(pak::pkg_install(pkgsAny)) # Fine dirTmp <- tempdir2(sub = \"second\") .libPaths(dirTmp) Require::Install(pkgs) # Fails try(pk <- pak::pak(c(\"PredictiveEcology/LandR@development\", \"PredictiveEcology/LandR@main\"))) # Error : ! error in pak subprocess # Caused by error: # ! Could not solve package dependencies: # * PredictiveEcology/LandR@development: Conflicts with PredictiveEcology/LandR@main # * PredictiveEcology/LandR@main: Conflicts with PredictiveEcology/LandR@development # Fine -- takes in order, so main first in this example rq <- Require::Install(c(\"PredictiveEcology/LandR@main\", \"PredictiveEcology/LandR@development\")) # Fine -- takes by version requirement, so takes development, # which is the only one that fulfills requirement on Jul 25, 2024 rq <- Require::Install(c(\"PredictiveEcology/LandR@main\", \"PredictiveEcology/LandR@development (>=1.1.5)\")) try(gg <- pak::pkg_deps(\"PredictiveEcology/LandR@development\", dependencies = TRUE)) ff <- Require::pkgDep(\"PredictiveEcology/LandR@development\", dependencies = TRUE)"},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"version-requirements-determine-package-installation","dir":"Articles","previous_headings":"How Require differs from other approaches","what":"Version requirements determine package installation","title":"The `Require` approach, comparing `pak` and `renv`","text":"Version number requirements drive package updates. user need update version numbers sufficient, update occur. version number specification, installs occur package present. Multiple simultaneous requests install package appear incompatible sources, create conflict unless version requirements cause conflict. version number requirements specified, CRAN versions take precedence, sequence packages listed installation take preference otherwise. Require can handle package version specifications function call (pak can handle DESCRIPTION file, >=), whereas pak (currently).","code":"# The following has no version specifications, # so CRAN version will be installed or none installed if already installed Require::Install(c(\"PredictiveEcology/reproducible@development\", \"reproducible\")) # The following specifies \"HEAD\" after the Github package name. This means the # tip of the development branch of reproducible will be installed if not already installed Require::Install(c(\"PredictiveEcology/reproducible@development (HEAD)\", \"reproducible\")) # The following specifies \"HEAD\" after the package name. This means the # tip of the development branch of reproducible Require::Install(c(\"PredictiveEcology/reproducible@development\", \"reproducible (HEAD)\")) # Not a problem because version number specifies Require::Install(c(\"PredictiveEcology/reproducible@modsForLargeArchives (>=2.0.10.9010)\", \"PredictiveEcology/reproducible (>= 2.0.10)\")) # Even if branch does not exist, if later version requirement specifies a different branch, no error Require::Install(c(\"PredictiveEcology/reproducible@modsForLargeArchives (>=2.0.10.9010)\", \"PredictiveEcology/reproducible@validityTest (>= 2.0.9)\")) ## FAILS - can't specify version requirements try(pak::pkg_install( c(\"PredictiveEcology/reproducible@modsForLargeArchives (>=2.0.10.9010)\", \"PredictiveEcology/reproducible (>= 2.0.10)\")))"},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"why-is-it-fast","dir":"Articles","previous_headings":"How Require differs from other approaches","what":"Why is it fast?","title":"The `Require` approach, comparing `pak` and `renv`","text":"features make fast first time used system, make fast second & subsequent time system (can first time new project). features caching, cloning, parallel downloads.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"caching","dir":"Articles","previous_headings":"How Require differs from other approaches > Why is it fast?","what":"Caching","title":"The `Require` approach, comparing `pak` and `renv`","text":"Require creates local cache several steps: packages files (source binary including locally built binaries); package dependency tree (RAM currently, affects session); available package matrices CRAN-like repositories. Together, speed installation packages computer can access local cache, e.g., new project. Require keeps binary source package built, can therefore install binary subsequent installation. results dramatically faster installations source packages built locally.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"cloning-still-experimental-do-not-default","dir":"Articles","previous_headings":"How Require differs from other approaches > Why is it fast?","what":"Cloning (still experimental; do not default)","title":"The `Require` approach, comparing `pak` and `renv`","text":"Require option, options(\"Require.cloneFrom\"), , set, create hard link current project’s package library library pointed option. Setting e.g. options(\"Require.cloneFrom\" = Sys.getenv(\"R_LIBS_USER\")) allow packages user’s personal library source “copying” project library. dramatically faster installing, even installation local binary local cache.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"binary-on-linux","dir":"Articles","previous_headings":"How Require differs from other approaches","what":"Binary on Linux","title":"The `Require` approach, comparing `pak` and `renv`","text":"Linux, users ability install binary packages pre-built e.g., Posit Package Manager. Sometimes binary incompatible user’s system, even though correct operating system. occurs generally several packages, thus must installed source. Require function sourcePkgs(), can informed options(\"Require.spatialPkgs\") options(\"Require.otherPkgs\") can set user package--package basis. default, automatically installed \"source\" experience, tend fail installed binary.","code":"# In this example, it is `terra` that must be installed from source on Linux if (Require:::isLinux()) { Require::setLinuxBinaryRepo() pkgs <- c(\"terra\", \"PSPclean\") pkgFullName <- \"ianmseddy/PSPclean@development\" try(remove.packages(pkgs)) pak::cache_delete() # make sure a locally built one is not present in the cache try(pak::pkg_install(pkgFullName)) # ✔ Loading metadata database ... done # # → Will install 2 packages. # → Will download 2 packages with unknown size. # + PSPclean 0.1.4.9005 [bld][cmp][dl] (GitHub: fed9253) # + terra 1.7-71 [dl] + ✔ libgdal-dev, ✔ gdal-bin, ✔ libgeos-dev, ✔ libproj-dev, ✔ libsqlite3-dev # ✔ All system requirements are already installed. # # ℹ Getting 2 pkgs with unknown sizes # ✔ Got PSPclean 0.1.4.9005 (source) (43.29 kB) # ✔ Got terra 1.7-71 (x86_64-pc-linux-gnu-ubuntu-22.04) (4.24 MB) # ✔ Downloaded 2 packages (4.28 MB) in 2.9s # ✔ Installed terra 1.7-71 (61ms) # ℹ Packaging PSPclean 0.1.4.9005 # ✔ Packaged PSPclean 0.1.4.9005 (420ms) # ℹ Building PSPclean 0.1.4.9005 # ✖ Failed to build PSPclean 0.1.4.9005 (3.7s) # Error: # ! error in pak subprocess # Caused by error in `stop_task_build(state, worker)`: # ! Failed to build source package PSPclean. # Type .Last.error to see the more details. # Works fine because the `sourcePkgs()` try(remove.packages(pkgs)) # uninstall to make sure it is a clean install for this test Require::cacheClearPackages(pkgs, ask = FALSE) # remove any existing local packages Require::Install(pkgFullName) }"},{"path":[]},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"default-arguments-pkgdep----which-xx-includes-linkingto","dir":"Articles","previous_headings":"How Require differs from other approaches > Package dependencies","what":"default arguments – pkgDep(..., which = XX) includes LinkingTo","title":"The `Require` approach, comparing `pak` and `renv`","text":"pkgDep, default, includes LinkingTo required Rcpp required, strictly necessary. pak::pkg_deps include LinkingTo default.","code":"depPak <- pak::pkg_deps(\"PredictiveEcology/LandR@LandWeb\") depRequire <- Require::pkgDep(\"PredictiveEcology/LandR@LandWeb\") # Slightly different default in Require # Same pakDepsClean <- setdiff(Require::extractPkgName(depPak$ref), Require:::.basePkgs) requireDepsClean <- setdiff(Require::extractPkgName(depRequire[[1]]), Require:::.basePkgs) setdiff(pakDepsClean, requireDepsClean) setdiff(requireDepsClean, pakDepsClean) # does not report \"RcppArmadillo\", \"RcppEigen\", \"cpp11\" which are LinkingTo"},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"cran-preference","dir":"Articles","previous_headings":"How Require differs from other approaches","what":"CRAN-preference","title":"The `Require` approach, comparing `pak` and `renv`","text":"version specification, Require prefers CRAN packages multiple pointers package. Thus, even though package may Remotes field pointing e.g., PredictiveEcology/SpaDES.tools@development, recursive dependency within package specifies SpaDES.tools without Remotes field, pkgDep return CRAN version. user wants override behaviour, user can specify version requirement can satisfied Remotes option. pkgDep take . pak::pkg_deps prefers top-level specification, .e., non-recursive Remotes field returned, even package also specified within recursive dependency without Remotes field, .e, recursive dependency points CRAN package, return version dependency.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"pak-fails-for-packages-on-github-that-are-not-same-name-as-git-repo-in-remotes","dir":"Articles","previous_headings":"How Require differs from other approaches > CRAN-preference","what":"pak fails for packages on GitHub that are not same name as Git Repo in Remotes","title":"The `Require` approach, comparing `pak` and `renv`","text":"","code":"gg <- pak::pkg_deps(\"PredictiveEcology/LandR@development\", dependencies = TRUE) # Error: # ! error in pak subprocess # Caused by error: # ! Could not solve package dependencies: # * PredictiveEcology/LandR@development: Can't install dependency BioSIM # * BioSIM: Can't find package called BioSIM. # Type .Last.error to see the more details. ff <- Require::pkgDep(\"PredictiveEcology/LandR@development\", dependencies = TRUE) # $`PredictiveEcology/LandR@development` # [1] \"BH\" \"BIEN\" # [3] \"BioSIM\" \"DBI (>= 0.8)\" # [5] \"Deriv\" \"ENMeval\" # ..."},{"path":[]},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"managing-projects-during-development","dir":"Articles","previous_headings":"renv and Require","what":"Managing projects during development","title":"The `Require` approach, comparing `pak` and `renv`","text":"renv concept lockfile. lockfile records specific version package. current installed version package different lockfile (e.g., developer increment local version), renv attempt revert local changes (prompt confirm) unless local package installed cloud repository (e.g., GitHub), snapshot taken. sequence largely incompatible pkgload::load_all() devtools::install(), record “” get current version . Thus, renv sequence can quite time consuming (1-2 minutes, instead 1 second pkgload::load_all()). Require attempt update anything unless required package. Thus, issue never comes . important “snapshot”, pkgSnapshot pkgSnapshot2 can used.","code":""},{"path":"https://Require.predictiveecology.org/articles/Require.html","id":"using-description-file-to-maintain-minimum-versions","dir":"Articles","previous_headings":"renv and Require","what":"Using DESCRIPTION file to maintain minimum versions","title":"The `Require` approach, comparing `pak` and `renv`","text":"project, user can build maintain “project-level” DESCRIPTION file, can useful renv managed project. approach , however, automatically detect minimum version changes GitHub branch changes (renv::status recognize ). order user inherit correct requirements, manual renv::install must used. even moderate sized projects, can take 20 seconds. Require need lockfile; package violations found fly.","code":""},{"path":"https://Require.predictiveecology.org/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Eliot J B McIntire. Author, maintainer. Alex M Chubaty. Contributor. Majesty Queen Right Canada, represented Minister Natural Resources Canada. Copyright holder.","code":""},{"path":"https://Require.predictiveecology.org/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"McIntire E (2024). Require: Installing Loading R Packages Reproducible Workflows. R package version 1.0.0, https://github.com/PredictiveEcology/Require, https://Require.predictiveecology.org.","code":"@Manual{, title = {Require: Installing and Loading R Packages for Reproducible Workflows}, author = {Eliot J B McIntire}, year = {2024}, note = {R package version 1.0.0, https://github.com/PredictiveEcology/Require}, url = {https://Require.predictiveecology.org}, }"},{"path":"https://Require.predictiveecology.org/index.html","id":"require","dir":"","previous_headings":"","what":"Installing and Loading R Packages for Reproducible Workflows","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Require single package combines features base::install.packages, base::library, base::require, well pak::pkg_install, remotes::install_github, versions::install_version, plus snapshotting capabilities renv. takes name idea user simply one line like : named require function, load packages. Require, also install packages, necessary. Set forget . makes clear packages used project. Require also continues work, even packages taken CRAN. means even dependency removed CRAN (“archived”), line still work. can done one line, becomes relatively easy share, transparent, facilitates reproducibility (especially combined version specifications). turn facilitate, example, making reprexes debugging.","code":"Require(c(\"dplyr\", \"lmer\", \"PredictiveEcology/LandR@development\"))"},{"path":"https://Require.predictiveecology.org/index.html","id":"objectives","dir":"","previous_headings":"","what":"Objectives","title":"Installing and Loading R Packages for Reproducible Workflows","text":"packages many package dependencies. CRAN; development may hosted elsewhere. Mixing many package dependencies constantly evolving creates challenges standard R package management. example, best way move analyses one machine another, set series High Performance Compute nodes? use functions like install.packages reproducible workflow clearly intended used times? deal many packages GitHub many common dependencies, may point different branches GitHub repository? deal packages dependencies longer CRAN (“archived”)? replicate analysis 6 months now packages changed, dependencies changed?","code":""},{"path":"https://Require.predictiveecology.org/index.html","id":"require--install","dir":"","previous_headings":"","what":"Require & Install","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Require package provides two “rerun-tolerant” functions, Require Install. “Rerun-tolerant” means results running function (output) identical time, even conditions run different. means one packages installed prior running function, function determine installed, install continue . packages missing, install anything. function uses RAM disk caching, first time run new R session slower subsequent times cached copies e.g., package dependency tree, can used. “Rerun-tolerant” requirement robust reproducible workflow; every “manual” break code (.e., user runs bit code, skips lines, runs etc.) provides potential sections code become stale without user aware. Install Require identical except Require also call require (lower case r) named packages default setting require = TRUE.","code":""},{"path":"https://Require.predictiveecology.org/index.html","id":"converting-to-using-require","dir":"","previous_headings":"","what":"Converting to using Require","title":"Installing and Loading R Packages for Reproducible Workflows","text":"lines: become: noting Require extra package, fully reproducible, needs installed first.","code":"if (!require(\"dplyr\")) {install.packages(\"dplyr\"); require(\"dplyr\")} if (!require(\"lme4\")) {install.packages(\"lme4\"); require(\"lme4\")} if (!require(\"tidyverse\")) {install.packages(\"tidyverse\"); require(\"tidyverse\")} if (!require(\"Require\")) {install.packages(\"Require\"); require(\"Require\")} Require(c(\"dplyr\", \"lme4\", \"tidyverse\"))"},{"path":"https://Require.predictiveecology.org/index.html","id":"other-packages-that-also-install-packages","dir":"","previous_headings":"","what":"Other packages that also install packages","title":"Installing and Loading R Packages for Reproducible Workflows","text":"descriptions necessarily simple; please go see package details. , highlight key features relevant README. Require offers different way achieve features 5 packages necessary build unified, organic, yet reproducible approach package management one many projects.","code":""},{"path":"https://Require.predictiveecology.org/index.html","id":"pak","dir":"","previous_headings":"Other packages that also install packages","what":"pak","title":"Installing and Loading R Packages for Reproducible Workflows","text":"pak focuses fast installations current versions packages CRAN-like packages GitHub.com similar code-sharing pages. works well objective keep current. fast.","code":"# These lines pak::pkg_install(c(\"dplyr\", \"lme4\")) # become Require::Install(c(\"dplyr\", \"lme4\"))"},{"path":"https://Require.predictiveecology.org/index.html","id":"renv","dir":"","previous_headings":"Other packages that also install packages","what":"renv","title":"Installing and Loading R Packages for Reproducible Workflows","text":"renv tool help static package installation process. can handle packages updated manually individual, key strength around keeping track versions exist project. renv intended expose code used install packages. makes managing packages separate script /used project, .e., package script contain necessary information recreate package library.","code":"renv::snapshot() # becomes Require::pkgSnapshot()"},{"path":"https://Require.predictiveecology.org/index.html","id":"packrat","dir":"","previous_headings":"Other packages that also install packages","what":"packrat","title":"Installing and Loading R Packages for Reproducible Workflows","text":"mostly predecessor renv. renv can everything packrat can , better.","code":""},{"path":"https://Require.predictiveecology.org/index.html","id":"checkpoint","dir":"","previous_headings":"Other packages that also install packages","what":"checkpoint","title":"Installing and Loading R Packages for Reproducible Workflows","text":"approach takes date input install packages user wants, date. uses posit.packagemanager.co servers hosted Posit.","code":"checkpoint(\"2022-11-09\") # cannot be achieved directly with Require, but Require(\"reproducible (==1.2.10)\") # which was the version on that date"},{"path":"https://Require.predictiveecology.org/index.html","id":"package-features","dir":"","previous_headings":"","what":"Package features","title":"Installing and Loading R Packages for Reproducible Workflows","text":"reproducible workflows – rerun-tolerant fast (see one example timings ) packages can CRAN, CRAN-alikes, GitHub.com uses .libPaths() like base-R true stand alone, folder-based approach used .libPaths(). example, user e.g., Windows Home packages installed system folder admin privileges allows , setting standAlone = TRUE ignore packages use ones .libPaths()[1] can use hierarchical library paths can take snapshots, keeping version information reinstallation another machine/system. See ?pkgSnapshot can use binary source installs; yet overrides user request likely inappropriate, e.g., Rcpp often fails installed Linux binary package manager. Spatial packages similar. uses local cache packages (defaults outside project, inside user’s home) multiple projects can install packages quickly without re-downloading cloud repositories (see RequireOptions()$Require.cachePkgDir) puts package installing compact form, can placed within project source code, enhancing reproducibility transparency using function Require::Require, runs require every package, order, supplied packages argument","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/index.html","id":"news","dir":"","previous_headings":"","what":"News","title":"Installing and Loading R Packages for Reproducible Workflows","text":"See updates latest CRAN development versions.","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/index.html","id":"current-release","dir":"","previous_headings":"Installation","what":"Current release","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Install CRAN: Install development version:","code":"install.packages(\"Require\") # Installing the development binary (Windows/MacOS) install.packages(\"Require\", repos = \"https://predictiveecology.r-universe.dev\") # Or installing from source if (!require(\"remotes\")) install.packages(\"remotes\") remotes::install_github(\"PredictiveEcology/Require\")"},{"path":"https://Require.predictiveecology.org/index.html","id":"development-version","dir":"","previous_headings":"Installation","what":"Development version","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Install r-universe: development version package:","code":"install.packages(\"Require\", repose = \"https://predictiveecology.r-universe.dev\")"},{"path":"https://Require.predictiveecology.org/index.html","id":"basic-usage","dir":"","previous_headings":"","what":"Basic usage","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Require wrapper around functions utils::install packages one main function load packages, base::require. Like install.packages, vectorized package names.","code":"if (!require(\"Require\")) {install.packages(\"Require\")} # sadly, Require can't install itself Require::Require(\"data.table\") # With version numbering, this will install data.table, and also check that the installed # version is greater than 1.12.8; if not, then it will install a newer version Require(\"data.table (>=1.12.8)\") # vectorized, mixed github and CRAN, mixed version number and not Require(c(\"data.table (>=1.12.8)\", \"PredictiveEcology/quickPlot\"))"},{"path":"https://Require.predictiveecology.org/index.html","id":"it-is-fast","dir":"","previous_headings":"","what":"It is fast","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Require optimized speed. pak fast, many cases Require faster. , cases packages already installed, Require 10x-20x faster, can left code.","code":"# First time run, > pkgs <- c(\"dplyr\", \"reproducible\", + \"PredictiveEcology/SpaDES@development\", \"terra\") > system.time(pak::pkg_install(pkgs)) ✔ Loading metadata database ... done ℹ No downloads are needed ✔ 4 pkgs + 39 deps: kept 40 [6.8s] user system elapsed 0.79 0.28 6.86 > system.time(Require::Install(pkgs)) 1 packages on GitHub 3 packages on GitHub No packages to install/update user system elapsed 0.44 0.07 0.51 > system.time(pak::pkg_install(pkgs)) # Second time run within same session ℹ No downloads are needed ✔ 4 pkgs + 39 deps: kept 40 [2.1s] user system elapsed 0.06 0.04 2.12 > system.time(Require::Install(pkgs)) No packages to install/update user system elapsed 0.05 0.02 0.06"},{"path":[]},{"path":"https://Require.predictiveecology.org/index.html","id":"keeping-it-all-isolated","dir":"","previous_headings":"Other features","what":"Keeping it all isolated","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Require can make install use single directory, project can fully isolated (unlike .libPaths(), always see packages R_HOME directory)","code":"library(Require) projectPackages = \"projectPackages\" dir.create(projectPackages) Require(\"remotes (>=2.4.0)\", standAlone = TRUE, libPaths = projectPackages)"},{"path":"https://Require.predictiveecology.org/index.html","id":"installing-old-package-versions","dir":"","previous_headings":"Other features","what":"Installing old package versions","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Require functionality renv versions can install previous versions. Windows, search binary version MRAN CRAN Archives. way , can specify maximum exact package versions.","code":"Require(\"fpCompare (<=0.1.0)\") # we don't have to know where to get this"},{"path":"https://Require.predictiveecology.org/index.html","id":"managing-a-project","dir":"","previous_headings":"Other features","what":"Managing a project","title":"Installing and Loading R Packages for Reproducible Workflows","text":"vectorized, can long list packages top project file, various sources version specifications.","code":"Install(c(\"dplyr (==1.1.4)\", \"reproducible\", \"PredictiveEcology/SpaDES@development\", \"raster (>=3.1.5)\"))"},{"path":"https://Require.predictiveecology.org/index.html","id":"taking-a-snapshot","dir":"","previous_headings":"Other features","what":"Taking a snapshot","title":"Installing and Loading R Packages for Reproducible Workflows","text":"system set correct packages versions, can take snapshot give file another person machine: argument packageVersionFile can also TRUE default filename accepted.","code":"library(Require) pkgSnapshot(\"mySnapshot.txt\", standAlone = TRUE) # to get only the project specific ones ## move to a new machine, say Require(packageVersionFile = \"mySnapshot.txt\")"},{"path":"https://Require.predictiveecology.org/index.html","id":"using-local-package-cache","dir":"","previous_headings":"Other features","what":"Using local package cache","title":"Installing and Loading R Packages for Reproducible Workflows","text":"installing many machines network, local cache can speed installations. default, activated, message upon package load cache folder . Setting options(\"Require.cachePkgDir\" = \"somePath\") move location; setting options(\"Require.cachePkgDir\" = NULL) turn caching . default, binaries saved Windows. Also default, binaries built fly *nix systems binary cached even faster installs later.","code":""},{"path":"https://Require.predictiveecology.org/index.html","id":"keeping-up-to-date","dir":"","previous_headings":"Other features","what":"Keeping up to date","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Require generally try keep packages date; instead defaults keeping packages sufficiently date violate version requirements. However, Require 2 mechanisms keep packages date: either group using update = TRUE (upgrade = TRUE) argument Require using (HEAD) specification individual package. Using (HEAD) allows user always latest version individual packages, without wholesale updating.","code":"Require(\"PredictiveEcology/reproducible@development (HEAD)\") # will install reproducible if it has change on GitHub. Require(\"reproducible\", update = TRUE) # will update reproducible and all dependencies"},{"path":"https://Require.predictiveecology.org/index.html","id":"conclusion","dir":"","previous_headings":"","what":"Conclusion","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Require package offers simple package focused around single function “rerun-tolerant”, .e., take sufficiently little time execute can left script run every time, even ongoing work. package two dependencies (data.table sys) can used install packages without interfering .","code":""},{"path":"https://Require.predictiveecology.org/index.html","id":"contributions","dir":"","previous_headings":"","what":"Contributions","title":"Installing and Loading R Packages for Reproducible Workflows","text":"Please see CONTRIBUTING.md information contribute project.","code":""},{"path":"https://Require.predictiveecology.org/reference/DESCRIPTION-helpers.html","id":null,"dir":"Reference","previous_headings":"","what":"GitHub package tools — DESCRIPTIONFileVersionV","title":"GitHub package tools — DESCRIPTIONFileVersionV","text":"series helpers access deal GitHub packages","code":""},{"path":"https://Require.predictiveecology.org/reference/DESCRIPTION-helpers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"GitHub package tools — DESCRIPTIONFileVersionV","text":"","code":"DESCRIPTIONFileVersionV(file, purge = getOption(\"Require.purge\", FALSE)) DESCRIPTIONFileOtherV(file, other = \"RemoteSha\") dlGitHubDESCRIPTION( pkg, purge = getOption(\"Require.purge\", FALSE), verbose = getOption(\"Require.verbose\") )"},{"path":"https://Require.predictiveecology.org/reference/DESCRIPTION-helpers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"GitHub package tools — DESCRIPTIONFileVersionV","text":"file file path DESCRIPTION file purge Logical. caches purged? Default getOption(\"Require.purge\", FALSE). lot internal caching results throughout Require package. help speed reduce calls internet sources. However, sometimes caches must purged. cached values renewed found old, age limit. maximum age can set seconds environment variable R_AVAILABLE_PACKAGES_CACHE_CONTROL_MAX_AGE, unset, defaults 3600 (one hour – see utils::available.packages). Internally, calls available.packages. keyword DESCRIPTION file precedes \":\". rest line retrieved. pkg character string GitHub package specification (c.f. remotes) verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/DESCRIPTION-helpers.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"GitHub package tools — DESCRIPTIONFileVersionV","text":"dlGitHubDESCRIPTION retrieves DESCRIPTION file GitHub.com","code":""},{"path":"https://Require.predictiveecology.org/reference/GitHubTools.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse a github package specification — parseGitHub","title":"Parse a github package specification — parseGitHub","text":"converts specification like PredictiveEcology/Require@development separate columns, \"Account\", \"Repo\", \"Branch\", \"GitSubFolder\" (one)","code":""},{"path":"https://Require.predictiveecology.org/reference/GitHubTools.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse a github package specification — parseGitHub","text":"","code":"parseGitHub(pkgDT, verbose = getOption(\"Require.verbose\"))"},{"path":"https://Require.predictiveecology.org/reference/GitHubTools.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse a github package specification — parseGitHub","text":"pkgDT pkgDT data.table. verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/GitHubTools.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parse a github package specification — parseGitHub","text":"parseGitHub returns data.table added columns.","code":""},{"path":"https://Require.predictiveecology.org/reference/GitHubTools.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Parse a github package specification — parseGitHub","text":"parseGitHub turns single character string representation 3 4: Account, Repo, Branch, SubFolder.","code":""},{"path":"https://Require.predictiveecology.org/reference/R_TESTSomit.html","id":null,"dir":"Reference","previous_headings":"","what":"This environment variable ","title":"This environment variable ","text":"environment variable set : https://github.com/wch/r-source/blob/8b6429feb661b02e2b2b6df1757b31cf1250a33e/src/library/tools/R/testing.R#L472-Lundefined","code":""},{"path":"https://Require.predictiveecology.org/reference/R_TESTSomit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This environment variable ","text":"","code":"R_TESTSomit()"},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":null,"dir":"Reference","previous_headings":"","what":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"single key function, 'Require' makes rerun-tolerant versions 'install.packages' `require` CRAN packages, packages longer CRAN (.e., archived), specific versions packages, GitHub packages. approach developed create reproducible workflows flexible fast enough use development stages, able build snapshots stable package collection found. functions reproducible workflow, package emphasizes functions return result whether first subsequent times running function, subsequent times sufficiently fast can run every time without undue waiting burden user developer. \"one\" function run install.packages CRAN GitHub https://github.com/ packages install specific versions package versions specified either via ()equality (e.g., \"glue (>=1.6.2)\" \"glue (==1.6.2)\" exact version) packageVersionFile. require = TRUE, default, function run require named packages satisfy version requirements. packages already installed (packages supplied), optional version numbers satisfied, \"install\" component skipped.","code":""},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"","code":"Require( packages, packageVersionFile, libPaths, install_githubArgs = list(), install.packagesArgs = list(INSTALL_opts = \"--no-multiarch\"), standAlone = getOption(\"Require.standAlone\", FALSE), install = getOption(\"Require.install\", TRUE), require = getOption(\"Require.require\", TRUE), repos = getOption(\"repos\"), purge = getOption(\"Require.purge\", FALSE), verbose = getOption(\"Require.verbose\", FALSE), type = getOption(\"pkgType\"), upgrade = FALSE, returnDetails = FALSE, ... ) Install( packages, packageVersionFile, libPaths, install_githubArgs = list(), install.packagesArgs = list(INSTALL_opts = \"--no-multiarch\"), standAlone = getOption(\"Require.standAlone\", FALSE), install = TRUE, repos = getOption(\"repos\"), purge = getOption(\"Require.purge\", FALSE), verbose = getOption(\"Require.verbose\", FALSE), type = getOption(\"pkgType\"), upgrade = FALSE, ... )"},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"packages Either character vector packages install via install.packages, load (.e., library), , convenience, vector list (using c list) unquoted package names install /load (require, vectorized). Passing vectors names may work cases, user confirm relying behaviour operational code. case GitHub package, assumed name repository name package. case, pass named character vector , names package names different GitHub repository name. packageVersionFile Character string file name logical. TRUE, function load default file, getOption(\"Require.packageVersionFile\"). argument provided, override packages passed packages. default, Require attempt resolve dependency violations (.e., packageVersionFile specifies version package violates dependency specification another package). user wishes attempt install packageVersionFile without assessing dependencies, set dependencies = FALSE. libPaths library path (libraries) packages installed, looked load (.e., call library). can used create isolated, stand alone package installations, used standAlone = TRUE. Currently, path supplied prepended .libPaths() (temporarily call) Require standAlone = FALSE set (temporarily) .libPaths() c(libPaths, tail(libPaths(), 1) keep base packages. install_githubArgs Deprecated. Values passed merged install.packagesArgs, install.packagesArgs taking precedence conflicting. install.packagesArgs List optional named arguments, passed install.packages. Default ---multi-arch, meaning current architecture built installed (e.g., 64 bit, 32 bit, many cases). standAlone Logical. TRUE, packages installed loaded libPaths . NOTE: TRUE, CHANGE USER'S .libPaths(), similar e.g., checkpoint package. FALSE, libPath prepended .libPaths() Require call, resulting shared packages, .e., include user's default package folder(s). can create dramatically faster installs user substantial number packages already personal library. Default FALSE minimize package installing. install Logical \"force\". FALSE, try install anything. \"force\", force installation requested packages, mimicking call e.g., install.packages. TRUE, default, function try install missing packages dependencies. require Logical character string. TRUE, default, function attempt call require requested packages, possibly installed. character string, call require specific packages (.e., install ones listed packages, load packages listed require) repos remote repository (e.g., CRAN mirror), passed either install.packages, install_github installVersions. purge Logical. caches purged? Default getOption(\"Require.purge\", FALSE). lot internal caching results throughout Require package. help speed reduce calls internet sources. However, sometimes caches must purged. cached values renewed found old, age limit. maximum age can set seconds environment variable R_AVAILABLE_PACKAGES_CACHE_CONTROL_MAX_AGE, unset, defaults 3600 (one hour – see utils::available.packages). Internally, calls available.packages. verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility). type See utils::install.packages upgrade FALSE, default, upgrade package version local library adequate version requirements packages. Note: convenience, update can used argument. returnDetails Logical. TRUE return object attribute: attr(.., \"Require\") lots information processes installs. ... Passed install.packages. Good candidates e.g., type dependencies. can used install_githubArgs install.packageArgs give individual options 2 internal function calls.","code":""},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"Require intended replace base::require, thus returns logical, named vector indicating whether named packages loaded. Require also ability install packages, return value FALSE mean install correctly; rather, means attach require, install correctly, also e.g., require = FALSE. standAlone either put Required packages dependencies within libPaths (TRUE) FALSE install packages dependencies otherwise installed .libPaths()[1], .e., current active R package directory. packages dependencies yet installed installed libPaths.","code":""},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"Install Require(..., require = FALSE), convenience.","code":""},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"advanced use diagnosis, user can set verbose = TRUE 1 2 (via options(\"Require.verbose\")). attach attribute attr(obj, \"Require\") output function.","code":""},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"github-package","dir":"Reference","previous_headings":"","what":"GitHub Package","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"Follows remotes::install_github standard. remotes::install_github, possible specify past version GitHub package unless version tag user passes SHA package version. Similarly, developer local install e.g., via pkgload::install, active project, package able know GitHub state, thus pkgSnapshot able recover state SHA associated local installation. Use Require (remotes::install_github) create record GitHub state.","code":""},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"package-snapshots","dir":"Reference","previous_headings":"","what":"Package Snapshots","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"build snapshot desired packages versions, first run Require packages, pkgSnapshot. libPaths used, must used functions.","code":""},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"mutual-dependencies","dir":"Reference","previous_headings":"","what":"Mutual Dependencies","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"function works best required packages called within one Require call, dependencies can identified together, package versions addressed (conflicts), allowing call pkgSnapshot() take snapshot \"record\" current collection packages versions.","code":""},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"local-cache-of-packages","dir":"Reference","previous_headings":"","what":"Local Cache of Packages","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"installing new packages, Require put source binary files R-version specific subfolder getOption(\"Require.cachePkgDir\") whose default RPackageCache(), meaning cache packages locally project-independent location, reuse needed. turn feature, set options(\"Require.cachePkgDir\" = FALSE).","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"Maintainer: Eliot J B McIntire eliot.mcintire@canada.ca (ORCID) contributors: Alex M Chubaty achubaty@-cast.ca (ORCID) [contributor] Majesty Queen Right Canada, represented Minister Natural Resources Canada [copyright holder]","code":""},{"path":"https://Require.predictiveecology.org/reference/Require.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Require: Installing and Loading R Packages for Reproducible Workflows — Require-package","text":"","code":"if (FALSE) { # \\dontrun{ opts <- Require:::.setupExample() library(Require) getCRANrepos(ind = 1) Require(\"utils\") # analogous to require(stats), but it checks for # pkg dependencies, and installs them, if missing # unquoted version Require(c(tools, utils)) if (Require:::.runLongExamples()) { # Install in a new local library (libPaths) tempPkgFolder <- file.path(tempdir(), \"Require/Packages\") # use standAlone, means it will put it in libPaths, even if it already exists # in another local library (e.g., personal library) Install(\"crayon\", libPaths = tempPkgFolder, standAlone = TRUE) # Mutual dependencies, only installs once -- e.g., cli tempPkgFolder <- file.path(tempdir(), \"Require/Packages\") Install(c(\"cli\", \"R6\"), libPaths = tempPkgFolder, standAlone = TRUE) # Mutual dependencies, only installs once -- e.g., rlang tempPkgFolder <- file.path(tempdir(), \"Require/Packages\") Install(c(\"rlang\", \"ellipsis\"), libPaths = tempPkgFolder, standAlone = TRUE) ##################################################################################### # Isolated projects -- Use a project folder and pass to libPaths or set .libPaths() # ##################################################################################### # GitHub packages if (requireNamespace(\"gitcreds\", quietly = TRUE)) { #if (is(try(gitcreds::gitcreds_get(), silent = TRUE), \"gitcreds\")) { ProjectPackageFolder <- file.path(tempdir(), \"Require/ProjectA\") if (requireNamespace(\"curl\")) { Require(\"PredictiveEcology/fpCompare@development\", libPaths = ProjectPackageFolder, ) } # No install because it is there already Install(\"PredictiveEcology/fpCompare@development\", libPaths = ProjectPackageFolder, ) # the latest version on GitHub ############################################################################ # Mixing and matching GitHub, CRAN, with and without version numbering ############################################################################ pkgs <- c( \"remotes (<=2.4.1)\", # old version \"digest (>= 0.6.28)\", # recent version \"PredictiveEcology/fpCompare@a0260b8476b06628bba0ae73af3430cce9620ca0\" # exact version ) Require::Require(pkgs, libPaths = ProjectPackageFolder) #} } Require:::.cleanup(opts) } } # }"},{"path":"https://Require.predictiveecology.org/reference/RequireOptions.html","id":null,"dir":"Reference","previous_headings":"","what":"Require options — RequireOptions","title":"Require options — RequireOptions","text":"provide top-level, powerful settings comprehensive reproducible workflow. See Details .","code":""},{"path":"https://Require.predictiveecology.org/reference/RequireOptions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Require options — RequireOptions","text":"","code":"RequireOptions() getRequireOptions()"},{"path":"https://Require.predictiveecology.org/reference/RequireOptions.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Require options — RequireOptions","text":"RequireOptions() prints default values package options set startup, may changed (e.g., user) current session. getRequireOptions() prints current values package options. options can set options(\"Require.xxx\" = newValue), xxx one values , newValue new value give option. Sometimes options can placed user's .Rprofile file persist sessions. following options likely interest users: install Default: TRUE. default argument Require, affect Install. FALSE, installations attempted, missing packages result error. RPackageCache Default: cacheGetOptionCachePkgDir(), must either path logical. turn package caching, set FALSE. can set using environment variable e.g. Sys.setenv(R_REQUIRE_PKG_CACHE = \"somePath\"), Sys.setenv(R_REQUIRE_PKG_CACHE = \"TRUE\"); set, either path logical option (options(Require.cachePkgDir = \"somePath\") options(Require.cachePkgDir = TRUE)). TRUE, default folder location cachePkgDir() used. TRUE path provided, binary source packages cached . Subsequent downloads package use local copy. Default packages cached locally install version original source, e.g., CRAN, GitHub. otherPkgs Default: character vector packages generally successful installed Source Unix-alikes. Since repositories offer binary packages builds Linux (e.g., RStudio Package Manager), vector package names indicated default standard CRAN repository, forcing source install. See also spatialPkgs option, spatial packages. purge Default: FALSE. set (almost) internal caches used Require deleted rebuilt. generally necessary automatically deleted (default) 1 hour (set via R_AVAILABLE_PACKAGES_CACHE_CONTROL_MAX_AGE environment variable seconds) spatialPkgs Default: character vector packages generally successful installed Source Unix-alikes. Since repositories offer binary packages builds Linux (e.g., RStudio Package Manager), vector package names indicated default standard CRAN repository, forcing source install. See also otherPkgs option, non-spatial packages. useCranCache Default: FALSE. user can optionally use locally cached packages available due user's use crancache package. verbose Default: 1. See ?Require.","code":""},{"path":"https://Require.predictiveecology.org/reference/availablePackagesOverride.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a custom ","title":"Create a custom ","text":"mechanism install.packages determines packages installed . override, can indicate arbitrary repos, Package, File individual package.","code":""},{"path":"https://Require.predictiveecology.org/reference/availablePackagesOverride.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a custom ","text":"","code":"availablePackagesOverride( toInstall, repos, purge, type = getOption(\"pkgType\"), verbose = getOption(\"Require.verbose\") )"},{"path":"https://Require.predictiveecology.org/reference/availablePackagesOverride.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a custom ","text":"toInstall pkgDT object repos remote repository (e.g., CRAN mirror), passed either install.packages, install_github installVersions. purge Logical. caches purged? Default getOption(\"Require.purge\", FALSE). lot internal caching results throughout Require package. help speed reduce calls internet sources. However, sometimes caches must purged. cached values renewed found old, age limit. maximum age can set seconds environment variable R_AVAILABLE_PACKAGES_CACHE_CONTROL_MAX_AGE, unset, defaults 3600 (one hour – see utils::available.packages). Internally, calls available.packages. type See utils::install.packages verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/availableVersionOK.html","id":null,"dir":"Reference","previous_headings":"","what":"Needs VersionOnRepos, versionSpec and inequality columns — availableVersionOK","title":"Needs VersionOnRepos, versionSpec and inequality columns — availableVersionOK","text":"Needs VersionOnRepos, versionSpec inequality columns","code":""},{"path":"https://Require.predictiveecology.org/reference/availableVersionOK.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Needs VersionOnRepos, versionSpec and inequality columns — availableVersionOK","text":"","code":"availableVersionOK(pkgDT)"},{"path":"https://Require.predictiveecology.org/reference/availableVersionOK.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Needs VersionOnRepos, versionSpec and inequality columns — availableVersionOK","text":"pkgDT pkgDT object","code":""},{"path":"https://Require.predictiveecology.org/reference/availableVersions.html","id":null,"dir":"Reference","previous_headings":"","what":"Available and archived versions — dlArchiveVersionsAvailable","title":"Available and archived versions — dlArchiveVersionsAvailable","text":"wrappers around available.packages also get archived versions available CRAN.","code":""},{"path":"https://Require.predictiveecology.org/reference/availableVersions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Available and archived versions — dlArchiveVersionsAvailable","text":"","code":"dlArchiveVersionsAvailable( package, repos = getOption(\"repos\"), verbose = getOption(\"Require.verbose\") ) available.packagesCached( repos, purge, verbose = getOption(\"Require.verbose\"), returnDataTable = TRUE, type )"},{"path":"https://Require.predictiveecology.org/reference/availableVersions.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Available and archived versions — dlArchiveVersionsAvailable","text":"package single package name (without version github specifications) repos remote repository (e.g., CRAN mirror), passed either install.packages, install_github installVersions. verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility). purge Logical. caches purged? Default getOption(\"Require.purge\", FALSE). lot internal caching results throughout Require package. help speed reduce calls internet sources. However, sometimes caches must purged. cached values renewed found old, age limit. maximum age can set seconds environment variable R_AVAILABLE_PACKAGES_CACHE_CONTROL_MAX_AGE, unset, defaults 3600 (one hour – see utils::available.packages). Internally, calls available.packages. returnDataTable Logical. TRUE, default, return data.table. Otherwise, matrix, per available.packages type See utils::install.packages","code":""},{"path":"https://Require.predictiveecology.org/reference/availableVersions.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Available and archived versions — dlArchiveVersionsAvailable","text":"dlArchiveVersionsAvailable searches CRAN Archives available versions. borrowed sub-set code non-exported function: remotes:::download_version_url","code":""},{"path":"https://Require.predictiveecology.org/reference/cacheDefaultDir.html","id":null,"dir":"Reference","previous_headings":"","what":"The default cache directory for Require Cache — cacheDefaultDir","title":"The default cache directory for Require Cache — cacheDefaultDir","text":"wrapper around tools::R_user_dir(\"Require\", = \"cache\") creates directory, exist.","code":""},{"path":"https://Require.predictiveecology.org/reference/cacheDefaultDir.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The default cache directory for Require Cache — cacheDefaultDir","text":"","code":"cacheDefaultDir()"},{"path":"https://Require.predictiveecology.org/reference/cacheDefaultDir.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"The default cache directory for Require Cache — cacheDefaultDir","text":"default cache directory","code":""},{"path":"https://Require.predictiveecology.org/reference/cacheDir.html","id":null,"dir":"Reference","previous_headings":"","what":"Path to (package) cache directory — cacheDir","title":"Path to (package) cache directory — cacheDir","text":"Sets (create = TRUE) gets cache directory associated Require package.","code":""},{"path":"https://Require.predictiveecology.org/reference/cacheDir.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Path to (package) cache directory — cacheDir","text":"","code":"cacheDir(create, verbose = getOption(\"Require.verbose\")) cachePkgDir(create)"},{"path":"https://Require.predictiveecology.org/reference/cacheDir.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Path to (package) cache directory — cacheDir","text":"create logical indicating whether path created exist. Default FALSE. verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/cacheDir.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Path to (package) cache directory — cacheDir","text":"!.null(cacheGetOptionCachePkgDir()), .e., cache path exists, cache directory created, README placed folder. Otherwise, function just return path cache directory .","code":""},{"path":"https://Require.predictiveecology.org/reference/cacheDir.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Path to (package) cache directory — cacheDir","text":"set different directory default, set system variable: R_USER_CACHE_DIR = \"somePath\" /R_REQUIRE_PKG_CACHE = \"somePath\" e.g., .Renviron file Sys.setenv(). See Note .","code":""},{"path":"https://Require.predictiveecology.org/reference/cacheDir.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Path to (package) cache directory — cacheDir","text":"Currently, 2 different Cache directories used Require: cacheDir cachePkgDir. cachePkgDir intended sub-directory cacheDir. set Sys.setenv(\"R_USER_CACHE_DIR\" = \"somedir\"), package cache cache dirs set, package cache sub-directory. can, however, set independently, set \"R_USER_CACHE_DIR\" \"R_REQUIRE_PKG_CACHE\" environment variable. package cache can also set options(\"Require.cachePkgDir\" = \"somedir\").","code":""},{"path":"https://Require.predictiveecology.org/reference/cacheGetOptionCachePkgDir.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the option for Require.cachePkgDir — cacheGetOptionCachePkgDir","title":"Get the option for Require.cachePkgDir — cacheGetOptionCachePkgDir","text":"First checks environment variable Require.cachePkgDir set defines path. set, checks whether options(\"Require.cachePkgDir\") set. character string, returns . TRUE, use cachePkgDir(). FALSE returns NULL.","code":""},{"path":"https://Require.predictiveecology.org/reference/cacheGetOptionCachePkgDir.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the option for Require.cachePkgDir — cacheGetOptionCachePkgDir","text":"","code":"cacheGetOptionCachePkgDir()"},{"path":"https://Require.predictiveecology.org/reference/cachePurge.html","id":null,"dir":"Reference","previous_headings":"","what":"Purge everything in the Require cache — cachePurge","title":"Purge everything in the Require cache — cachePurge","text":"Require uses caches local Package saving, local caches available.packages, local caches GitHub (e.g., \"DESCRIPTION\") files, function calls cached. function clears .","code":""},{"path":"https://Require.predictiveecology.org/reference/cachePurge.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Purge everything in the Require cache — cachePurge","text":"","code":"cachePurge(packages = FALSE, repos = getOption(\"repos\")) purgeCache(packages = FALSE, repos = getOption(\"repos\"))"},{"path":"https://Require.predictiveecology.org/reference/cachePurge.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Purge everything in the Require cache — cachePurge","text":"packages Either character vector packages install via install.packages, load (.e., library), , convenience, vector list (using c list) unquoted package names install /load (require, vectorized). Passing vectors names may work cases, user confirm relying behaviour operational code. case GitHub package, assumed name repository name package. case, pass named character vector , names package names different GitHub repository name. repos remote repository (e.g., CRAN mirror), passed either install.packages, install_github installVersions.","code":""},{"path":"https://Require.predictiveecology.org/reference/cachePurge.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Purge everything in the Require cache — cachePurge","text":"Run side effect, namely, cached objects removed.","code":""},{"path":"https://Require.predictiveecology.org/reference/checkLibPaths.html","id":null,"dir":"Reference","previous_headings":"","what":"Creates the directories, and adds version number — checkLibPaths","title":"Creates the directories, and adds version number — checkLibPaths","text":"Creates directories, adds version number","code":""},{"path":"https://Require.predictiveecology.org/reference/checkLibPaths.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates the directories, and adds version number — checkLibPaths","text":"","code":"checkLibPaths(libPaths, ifMissing, exact = FALSE, ...)"},{"path":"https://Require.predictiveecology.org/reference/checkLibPaths.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates the directories, and adds version number — checkLibPaths","text":"libPaths library path (libraries) packages installed, looked load (.e., call library). can used create isolated, stand alone package installations, used standAlone = TRUE. Currently, path supplied prepended .libPaths() (temporarily call) Require standAlone = FALSE set (temporarily) .libPaths() c(libPaths, tail(libPaths(), 1) keep base packages. ifMissing alternative path libPaths argument missing. exact Logical. FALSE, default, checkLibPaths append R version number libPaths supplied. TRUE, checkLibPaths return exactly libPaths supplied. ... used, allows functions pass arguments.","code":""},{"path":"https://Require.predictiveecology.org/reference/checkPath.html","id":null,"dir":"Reference","previous_headings":"","what":"Check directory path — checkPath","title":"Check directory path — checkPath","text":"Checks specified path directory formatting consistencies, trailing slashes, etc.","code":""},{"path":"https://Require.predictiveecology.org/reference/checkPath.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check directory path — checkPath","text":"","code":"checkPath(path, create) # S4 method for class 'character,logical' checkPath(path, create) # S4 method for class 'character,missing' checkPath(path) # S4 method for class 'NULL,ANY' checkPath(path) # S4 method for class 'missing,ANY' checkPath()"},{"path":"https://Require.predictiveecology.org/reference/checkPath.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check directory path — checkPath","text":"path character string corresponding directory path. create logical indicating whether path created exist. Default FALSE.","code":""},{"path":"https://Require.predictiveecology.org/reference/checkPath.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check directory path — checkPath","text":"Character string denoting cleaned filepath.","code":""},{"path":"https://Require.predictiveecology.org/reference/checkPath.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Check directory path — checkPath","text":"work paths files. check existence files, use file.exists(). normalize path file, use normPath() normalizePath().","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/reference/checkPath.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check directory path — checkPath","text":"","code":"## normalize file paths paths <- list(\"./aaa/zzz\", \"./aaa/zzz/\", \".//aaa//zzz\", \".//aaa//zzz/\", \".\\\\\\\\aaa\\\\\\\\zzz\", \".\\\\\\\\aaa\\\\\\\\zzz\\\\\\\\\", file.path(\".\", \"aaa\", \"zzz\")) checked <- normPath(paths) length(unique(checked)) ## 1; all of the above are equivalent #> [1] 3 ## check to see if a path exists tmpdir <- file.path(tempdir(), \"example_checkPath\") dir.exists(tmpdir) ## FALSE #> [1] FALSE tryCatch(checkPath(tmpdir, create = FALSE), error = function(e) FALSE) ## FALSE #> [1] FALSE checkPath(tmpdir, create = TRUE) #> [1] \"/tmp/RtmpimO25S/example_checkPath\" dir.exists(tmpdir) ## TRUE #> [1] TRUE unlink(tmpdir, recursive = TRUE) # clean up"},{"path":"https://Require.predictiveecology.org/reference/chooseCRANmirror2.html","id":null,"dir":"Reference","previous_headings":"","what":"Pass through function for chooseCRANmirror — chooseCRANmirror2","title":"Pass through function for chooseCRANmirror — chooseCRANmirror2","text":"allow mocking unit testing related chooseCRANmirror.","code":""},{"path":"https://Require.predictiveecology.org/reference/chooseCRANmirror2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pass through function for chooseCRANmirror — chooseCRANmirror2","text":"","code":"chooseCRANmirror2(...)"},{"path":"https://Require.predictiveecology.org/reference/chooseCRANmirror2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pass through function for chooseCRANmirror — chooseCRANmirror2","text":"... Passed chooseCRANmirror","code":""},{"path":"https://Require.predictiveecology.org/reference/clearRequire.html","id":null,"dir":"Reference","previous_headings":"","what":"Clear Require Cache elements — cacheClearPackages","title":"Clear Require Cache elements — cacheClearPackages","text":"Clear Require Cache elements","code":""},{"path":"https://Require.predictiveecology.org/reference/clearRequire.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clear Require Cache elements — cacheClearPackages","text":"","code":"cacheClearPackages( packages, ask = interactive(), Rversion = versionMajorMinor(), clearCranCache = FALSE, verbose = getOption(\"Require.verbose\") ) clearRequirePackageCache( packages, ask = interactive(), Rversion = versionMajorMinor(), clearCranCache = FALSE, verbose = getOption(\"Require.verbose\") )"},{"path":"https://Require.predictiveecology.org/reference/clearRequire.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clear Require Cache elements — cacheClearPackages","text":"packages Either missing character vector package names (currently specify version number) remove local Require Cache. ask Logical. TRUE, ask user confirm Rversion R version (major dot minor, e.g., \"4.2\"). Defaults current R version. clearCranCache Logical. TRUE, also clear local crancache cache, relevant options(Require.useCranCache = TRUE), .e., Require using crancache cache also verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/compareVersion2.html","id":null,"dir":"Reference","previous_headings":"","what":"Compare package versions — compareVersion2","title":"Compare package versions — compareVersion2","text":"Alternative utils::compareVersion vectorized version, versionSpec /inequality. also return NA element returned vector one arguments NA element.","code":""},{"path":"https://Require.predictiveecology.org/reference/compareVersion2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compare package versions — compareVersion2","text":"","code":"compareVersion2(version, versionSpec, inequality)"},{"path":"https://Require.predictiveecology.org/reference/compareVersion2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compare package versions — compareVersion2","text":"version One package versions. Can character numeric_version. versionSpec One versions compare . Can character numeric_version. inequality inequality use, .e., >=.","code":""},{"path":"https://Require.predictiveecology.org/reference/compareVersion2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compare package versions — compareVersion2","text":"logical vector length longest 3 arguments.","code":""},{"path":"https://Require.predictiveecology.org/reference/dealWithMissingLibPaths.html","id":null,"dir":"Reference","previous_headings":"","what":"Only checks for deprecated libPath argument (singular) — dealWithMissingLibPaths","title":"Only checks for deprecated libPath argument (singular) — dealWithMissingLibPaths","text":"checks deprecated libPath argument (singular)","code":""},{"path":"https://Require.predictiveecology.org/reference/dealWithMissingLibPaths.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Only checks for deprecated libPath argument (singular) — dealWithMissingLibPaths","text":"","code":"dealWithMissingLibPaths( libPaths, standAlone = getOption(\"Require.standAlone\", FALSE), ... )"},{"path":"https://Require.predictiveecology.org/reference/dealWithMissingLibPaths.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Only checks for deprecated libPath argument (singular) — dealWithMissingLibPaths","text":"libPaths library path (libraries) packages installed, looked load (.e., call library). can used create isolated, stand alone package installations, used standAlone = TRUE. Currently, path supplied prepended .libPaths() (temporarily call) Require standAlone = FALSE set (temporarily) .libPaths() c(libPaths, tail(libPaths(), 1) keep base packages. standAlone Logical. TRUE, packages installed loaded libPaths . NOTE: TRUE, CHANGE USER'S .libPaths(), similar e.g., checkpoint package. FALSE, libPath prepended .libPaths() Require call, resulting shared packages, .e., include user's default package folder(s). can create dramatically faster installs user substantial number packages already personal library. Default FALSE minimize package installing. ... Checks incorrect argument libPath (s)","code":""},{"path":"https://Require.predictiveecology.org/reference/detachAll.html","id":null,"dir":"Reference","previous_headings":"","what":"Detach and unload all packages — detachAll","title":"Detach and unload all packages — detachAll","text":"uses pkgDepTopoSort internally package dependency tree determined, packages unloaded reverse order. packages unload successfully variety reasons. Several known packages problem identified internally unloaded. Currently, glue, rlang, ps, ellipsis, , processx.","code":""},{"path":"https://Require.predictiveecology.org/reference/detachAll.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detach and unload all packages — detachAll","text":"","code":"detachAll( pkgs, dontTry = NULL, doSort = TRUE, verbose = getOption(\"Require.verbose\") )"},{"path":"https://Require.predictiveecology.org/reference/detachAll.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detach and unload all packages — detachAll","text":"pkgs character vector packages detach. topologically sorted unless doSort FALSE. dontTry character vector packages try. can used user find package fails attempts unload , e.g., \"ps\" doSort TRUE (default), pkgs topologically sorted. FALSE, . Useful pkgs already sorted. verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/detachAll.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Detach and unload all packages — detachAll","text":"numeric named vector, names packages attempted. 2 means package successfully unloaded, 1 tried, failed, 3 loaded, unloaded.","code":""},{"path":"https://Require.predictiveecology.org/reference/doLibPaths.html","id":null,"dir":"Reference","previous_headings":"","what":"Deals with missing libPaths arg, and takes first — doLibPaths","title":"Deals with missing libPaths arg, and takes first — doLibPaths","text":"Deals missing libPaths arg, takes first","code":""},{"path":"https://Require.predictiveecology.org/reference/doLibPaths.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Deals with missing libPaths arg, and takes first — doLibPaths","text":"","code":"doLibPaths(libPaths, standAlone = FALSE)"},{"path":"https://Require.predictiveecology.org/reference/doLibPaths.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Deals with missing libPaths arg, and takes first — doLibPaths","text":"libPaths library path (libraries) packages installed, looked load (.e., call library). can used create isolated, stand alone package installations, used standAlone = TRUE. Currently, path supplied prepended .libPaths() (temporarily call) Require standAlone = FALSE set (temporarily) .libPaths() c(libPaths, tail(libPaths(), 1) keep base packages. standAlone Logical. TRUE, packages installed loaded libPaths . NOTE: TRUE, CHANGE USER'S .libPaths(), similar e.g., checkpoint package. FALSE, libPath prepended .libPaths() Require call, resulting shared packages, .e., include user's default package folder(s). can create dramatically faster installs user substantial number packages already personal library. Default FALSE minimize package installing.","code":""},{"path":"https://Require.predictiveecology.org/reference/dot-downloadFileMasterMainAuth.html","id":null,"dir":"Reference","previous_headings":"","what":"GITHUB_PAT-aware and main-master-aware download from GitHub — .downloadFileMasterMainAuth","title":"GITHUB_PAT-aware and main-master-aware download from GitHub — .downloadFileMasterMainAuth","text":"Equivalent utils::download.file, taking GITHUB_PAT environment variable using access Github url.","code":""},{"path":"https://Require.predictiveecology.org/reference/dot-downloadFileMasterMainAuth.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"GITHUB_PAT-aware and main-master-aware download from GitHub — .downloadFileMasterMainAuth","text":"","code":".downloadFileMasterMainAuth( url, destfile, need = \"HEAD\", verbose = getOption(\"Require.verbose\"), verboseLevel = 2 )"},{"path":"https://Require.predictiveecology.org/reference/dot-downloadFileMasterMainAuth.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"GITHUB_PAT-aware and main-master-aware download from GitHub — .downloadFileMasterMainAuth","text":"url character string (longer vector \"libcurl\" method) naming URL resource downloaded. destfile character string (vector, see url argument) file path downloaded file saved. Tilde-expansion performed. need specified, user can suggest master main HEAD try first. unspecified, HEAD used. verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility). verboseLevel numeric indicating verbose threshold (level) message show.","code":""},{"path":"https://Require.predictiveecology.org/reference/dot-downloadFileMasterMainAuth.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"GITHUB_PAT-aware and main-master-aware download from GitHub — .downloadFileMasterMainAuth","text":"called side effect, namely, utils::download.file, using GITHUB_PAT, environment, trying master main actual url specifies either master main exist.","code":""},{"path":"https://Require.predictiveecology.org/reference/dot-installed.pkgs.html","id":null,"dir":"Reference","previous_headings":"","what":"Partial alternative (faster) to installed.packages — .installed.pkgs","title":"Partial alternative (faster) to installed.packages — .installed.pkgs","text":"reads DESCRIPTION files , can access fields available DESCRIPTION file. different installed.packages many fields, like \"Built\", \"NeedsCompilation\" etc. fields needed, function return empty column returned character matrix.","code":""},{"path":"https://Require.predictiveecology.org/reference/dot-installed.pkgs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Partial alternative (faster) to installed.packages — .installed.pkgs","text":"","code":".installed.pkgs( lib.loc = .libPaths(), which = c(\"Depends\", \"Imports\", \"LinkingTo\"), other = NULL, purge = getOption(\"Require.purge\", FALSE), packages = NULL, collapse = FALSE )"},{"path":"https://Require.predictiveecology.org/reference/dot-installed.pkgs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Partial alternative (faster) to installed.packages — .installed.pkgs","text":"lib.loc character vector describing location R library trees search , NULL known trees (see .libPaths). character vector listing types dependencies, subset c(\"Depends\", \"Imports\", \"LinkingTo\", \"Suggests\", \"Enhances\"). Character string \"\" shorthand vector, character string \"\" vector without \"Enhances\". Can supply fields; benefit user can specify \"github\" (lower case) automatically add c(\"GithubRepo\", \"GithubUsername\", \"GithubRef\", \"GithubSHA1\", \"GithubSubFolder\") fields purge Logical. caches purged? Default getOption(\"Require.purge\", FALSE). lot internal caching results throughout Require package. help speed reduce calls internet sources. However, sometimes caches must purged. cached values renewed found old, age limit. maximum age can set seconds environment variable R_AVAILABLE_PACKAGES_CACHE_CONTROL_MAX_AGE, unset, defaults 3600 (one hour – see utils::available.packages). Internally, calls available.packages. packages Character vector. NULL (default), installed packages searched . character vector supplied, return information packages (thus faster execute). collapse Logical. TRUE dependency fields collapsed; FALSE (default) fields kept separate.","code":""},{"path":"https://Require.predictiveecology.org/reference/envPkgCreate.html","id":null,"dir":"Reference","previous_headings":"","what":"1st level –> create the .pkgEnv object in Require — envPkgCreate","title":"1st level –> create the .pkgEnv object in Require — envPkgCreate","text":"1st level –> create .pkgEnv object Require","code":""},{"path":"https://Require.predictiveecology.org/reference/envPkgCreate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"1st level –> create the .pkgEnv object in Require — envPkgCreate","text":"","code":"envPkgCreate(parentEnv = asNamespace(\"Require\"))"},{"path":"https://Require.predictiveecology.org/reference/envPkgCreate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"1st level –> create the .pkgEnv object in Require — envPkgCreate","text":"parentEnv parent environment make new environment. Defaults asNamespace(\"Require\")","code":""},{"path":"https://Require.predictiveecology.org/reference/envPkgDepDESCFileCreate.html","id":null,"dir":"Reference","previous_headings":"","what":"3rd level for DESCRIPTIONFile — envPkgDepDESCFileCreate","title":"3rd level for DESCRIPTIONFile — envPkgDepDESCFileCreate","text":"3rd level DESCRIPTIONFile","code":""},{"path":"https://Require.predictiveecology.org/reference/envPkgDepDESCFileCreate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"3rd level for DESCRIPTIONFile — envPkgDepDESCFileCreate","text":"","code":"envPkgDepDESCFileCreate()"},{"path":"https://Require.predictiveecology.org/reference/envPkgDepDepsCreate.html","id":null,"dir":"Reference","previous_headings":"","what":"3rd level for deps ############################################# — envPkgDepDepsCreate","title":"3rd level for deps ############################################# — envPkgDepDepsCreate","text":"3rd level deps #############################################","code":""},{"path":"https://Require.predictiveecology.org/reference/envPkgDepDepsCreate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"3rd level for deps ############################################# — envPkgDepDepsCreate","text":"","code":"envPkgDepDepsCreate()"},{"path":"https://Require.predictiveecology.org/reference/extractPkgName.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract info from package character strings — extractPkgName","title":"Extract info from package character strings — extractPkgName","text":"Cleans character vector non-package name related information (e.g., version)","code":""},{"path":"https://Require.predictiveecology.org/reference/extractPkgName.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract info from package character strings — extractPkgName","text":"","code":"extractPkgName(pkgs, filenames) extractVersionNumber(pkgs, filenames) extractInequality(pkgs) extractPkgGitHub(pkgs)"},{"path":"https://Require.predictiveecology.org/reference/extractPkgName.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract info from package character strings — extractPkgName","text":"pkgs character string vector packages without GitHub path versions filenames Can supplied instead pkgs filename e.g., .tar.gz .zip downloaded CRAN.","code":""},{"path":"https://Require.predictiveecology.org/reference/extractPkgName.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract info from package character strings — extractPkgName","text":"Just package names without extraneous info.","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/reference/extractPkgName.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract info from package character strings — extractPkgName","text":"","code":"extractPkgName(\"Require (>=0.0.1)\") #> [1] \"Require\" extractVersionNumber(c( \"Require (<=0.0.1)\", \"PredictiveEcology/Require@development (<=0.0.4)\" )) #> [1] \"0.0.1\" \"0.0.4\" extractInequality(\"Require (<=0.0.1)\") #> [1] \"<=\" extractPkgGitHub(\"PredictiveEcology/Require\") #> [1] \"Require\""},{"path":"https://Require.predictiveecology.org/reference/getCRANrepos.html","id":null,"dir":"Reference","previous_headings":"","what":"A helper function to get or set CRAN repos — getCRANrepos","title":"A helper function to get or set CRAN repos — getCRANrepos","text":"get current option getOption('repos'), set url, prompt user select mirror, unless ind set, case, use mirror (chooseCRANmirror())","code":""},{"path":"https://Require.predictiveecology.org/reference/getCRANrepos.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A helper function to get or set CRAN repos — getCRANrepos","text":"","code":"getCRANrepos(repos = NULL, ind)"},{"path":"https://Require.predictiveecology.org/reference/getCRANrepos.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A helper function to get or set CRAN repos — getCRANrepos","text":"repos CRAN-like repository ind integer mirror use chooseCRANmirror()","code":""},{"path":"https://Require.predictiveecology.org/reference/getDeps.html","id":null,"dir":"Reference","previous_headings":"","what":"The packages argument may have up to 4 pieces of information for GitHub packages: name, repository, branch, version. For CRAN-alikes, it will only be 2 pieces: name, version. There can also be an inequality or equality, if there is a version. — getDeps","title":"The packages argument may have up to 4 pieces of information for GitHub packages: name, repository, branch, version. For CRAN-alikes, it will only be 2 pieces: name, version. There can also be an inequality or equality, if there is a version. — getDeps","text":"packages argument may 4 pieces information GitHub packages: name, repository, branch, version. CRAN-alikes, 2 pieces: name, version. can also inequality equality, version.","code":""},{"path":"https://Require.predictiveecology.org/reference/getDeps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The packages argument may have up to 4 pieces of information for GitHub packages: name, repository, branch, version. For CRAN-alikes, it will only be 2 pieces: name, version. There can also be an inequality or equality, if there is a version. — getDeps","text":"","code":"getDeps(pkgDT, which, recursive, type = type, repos, libPaths, verbose)"},{"path":"https://Require.predictiveecology.org/reference/getDeps.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"The packages argument may have up to 4 pieces of information for GitHub packages: name, repository, branch, version. For CRAN-alikes, it will only be 2 pieces: name, version. There can also be an inequality or equality, if there is a version. — getDeps","text":"pkgDT pkgDT object e.g., toPkgDT character vector listing types dependencies, subset c(\"Depends\", \"Imports\", \"LinkingTo\", \"Suggests\", \"Enhances\"). Character string \"\" shorthand vector, character string \"\" vector without \"Enhances\". recursive Logical. dependencies dependencies searched, recursively. NOTE: Dependencies suggests recursive. Default TRUE. type See utils::install.packages repos used ap. libPaths path search installed packages. Defaults .libPaths() verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/getDeps.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"The packages argument may have up to 4 pieces of information for GitHub packages: name, repository, branch, version. For CRAN-alikes, it will only be 2 pieces: name, version. There can also be an inequality or equality, if there is a version. — getDeps","text":"(named) vector SaveNames, concatenation 2 4 elements , plus recursive.","code":""},{"path":"https://Require.predictiveecology.org/reference/getDeps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"The packages argument may have up to 4 pieces of information for GitHub packages: name, repository, branch, version. For CRAN-alikes, it will only be 2 pieces: name, version. There can also be an inequality or equality, if there is a version. — getDeps","text":"version supplied, take local, installed version, exists. Otherwise, assumed HEAD desired. function find ap github.com. github packages, obviously slow step, can accelerated user supplies sha version e.g., getDeps(\"PredictiveEcology/LandR@development (==1.0.2)\")","code":""},{"path":"https://Require.predictiveecology.org/reference/invertList.html","id":null,"dir":"Reference","previous_headings":"","what":"Invert a 2-level list — invertList","title":"Invert a 2-level list — invertList","text":"simple version purrr::transpose, lists 2 levels.","code":""},{"path":"https://Require.predictiveecology.org/reference/invertList.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Invert a 2-level list — invertList","text":"","code":"invertList(l)"},{"path":"https://Require.predictiveecology.org/reference/invertList.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Invert a 2-level list — invertList","text":"l list 2 levels. levels absent, NULL","code":""},{"path":"https://Require.predictiveecology.org/reference/invertList.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Invert a 2-level list — invertList","text":"list 2 levels deep, inverted l","code":""},{"path":"https://Require.predictiveecology.org/reference/invertList.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Invert a 2-level list — invertList","text":"","code":"# create a 2-deep, 2 levels in first, 3 levels in second a <- list(a = list(d = 1, e = 2:3, f = 4:6), b = list(d = 5, e = 55)) invertList(a) # creates 2-deep, now 3 levels outer --> 2 levels inner #> $d #> $d$a #> [1] 1 #> #> $d$b #> [1] 5 #> #> #> $e #> $e$a #> [1] 2 3 #> #> $e$b #> [1] 55 #> #> #> $f #> $f$a #> [1] 4 5 6 #> #> $f$b #> NULL #> #>"},{"path":"https://Require.predictiveecology.org/reference/joinToAvailablePackages.html","id":null,"dir":"Reference","previous_headings":"","what":"Join a data.table with a Package column to available.packages — joinToAvailablePackages","title":"Join a data.table with a Package column to available.packages — joinToAvailablePackages","text":"join available.packages() pkgDT, pkgDT already column named Depends, indicator already happened.","code":""},{"path":"https://Require.predictiveecology.org/reference/joinToAvailablePackages.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Join a data.table with a Package column to available.packages — joinToAvailablePackages","text":"","code":"joinToAvailablePackages(pkgDT, repos, type, which, verbose)"},{"path":"https://Require.predictiveecology.org/reference/joinToAvailablePackages.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Join a data.table with a Package column to available.packages — joinToAvailablePackages","text":"pkgDT pkgDT object e.g., toPkgDT repos used ap. type See utils::install.packages character vector listing types dependencies, subset c(\"Depends\", \"Imports\", \"LinkingTo\", \"Suggests\", \"Enhances\"). Character string \"\" shorthand vector, character string \"\" vector without \"Enhances\". verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/joinToAvailablePackages.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Join a data.table with a Package column to available.packages — joinToAvailablePackages","text":"returned data.table columns available.packages appended pkgDT, including Depends, Imports, Suggests. change column name normally returned available.packages Version VersionOnRepos.","code":""},{"path":"https://Require.predictiveecology.org/reference/linkOrCopy.html","id":null,"dir":"Reference","previous_headings":"","what":"Create link to file, falling back to making a copy if linking fails. — linkOrCopy","title":"Create link to file, falling back to making a copy if linking fails. — linkOrCopy","text":"First try create hardlink file. fails, try symbolic link (symlink) falling back copying file. \"File\" can mean file directory.","code":""},{"path":"https://Require.predictiveecology.org/reference/linkOrCopy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create link to file, falling back to making a copy if linking fails. — linkOrCopy","text":"","code":"linkOrCopy(from, to, allowSymlink = FALSE) fileRenameOrMove(from, to)"},{"path":"https://Require.predictiveecology.org/reference/linkOrCopy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create link to file, falling back to making a copy if linking fails. — linkOrCopy","text":", character vectors, containing file names paths. allowSymlink Logical. FALSE, default, try file.link first, file.copy, omitting file.symlink step","code":""},{"path":"https://Require.predictiveecology.org/reference/masterMainToHead.html","id":null,"dir":"Reference","previous_headings":"","what":"This converts master or main to HEAD for a git repo — masterMainToHead","title":"This converts master or main to HEAD for a git repo — masterMainToHead","text":"also convert git repo nothing @ @HEAD","code":""},{"path":"https://Require.predictiveecology.org/reference/masterMainToHead.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This converts master or main to HEAD for a git repo — masterMainToHead","text":"","code":"masterMainToHead(gitRepo)"},{"path":"https://Require.predictiveecology.org/reference/masterMainToHead.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This converts master or main to HEAD for a git repo — masterMainToHead","text":"gitRepo git repository form account/repo optional @branch @sha @tag","code":""},{"path":"https://Require.predictiveecology.org/reference/masterMainToHead.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"This converts master or main to HEAD for a git repo — masterMainToHead","text":"git repository @HEAD @master, @main @.","code":""},{"path":"https://Require.predictiveecology.org/reference/messageVerbose.html","id":null,"dir":"Reference","previous_headings":"","what":"Use message to print a clean square data structure — messageDF","title":"Use message to print a clean square data structure — messageDF","text":"Sends message, structured way data.frame-like can cleanly sent messaging. show message value verbose greater verboseLevel. mostly useful developers code want give users code easy access verbose code . developer function place messageVerbose internally, setting verboseLevel according advanced may want message . 1 reasonable default standard use, 0 \"important message users\", 2 increasing levels details e.g., advanced use. user sets -1 numeric approach, can avoid messaging.","code":""},{"path":"https://Require.predictiveecology.org/reference/messageVerbose.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Use message to print a clean square data structure — messageDF","text":"","code":"messageDF(df, round, verbose = getOption(\"Require.verbose\"), verboseLevel = 1) messageVerbose(..., verbose = getOption(\"Require.verbose\"), verboseLevel = 1) messageVerboseCounter( pre = \"\", post = \"\", verbose = getOption(\"Require.verbose\"), verboseLevel = 1, counter = 1, total = 1, minCounter = 1 )"},{"path":"https://Require.predictiveecology.org/reference/messageVerbose.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Use message to print a clean square data structure — messageDF","text":"df data.frame, data.table, matrix round optional numeric pass round verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility). verboseLevel numeric indicating verbose threshold (level) message show. ... Passed install.packages. Good candidates e.g., type dependencies. can used install_githubArgs install.packageArgs give individual options 2 internal function calls. pre single text string paste counter post single text string paste counter counter integer indicating iteration done total integer indicating total number done. minCounter integer indicating minimum (.e,. starting value)","code":""},{"path":"https://Require.predictiveecology.org/reference/messageVerbose.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Use message to print a clean square data structure — messageDF","text":"Used side effects, namely messaging can turned different numeric values verboseLevel. user sets verboseLevel particular message.","code":""},{"path":"https://Require.predictiveecology.org/reference/modifyList2.html","id":null,"dir":"Reference","previous_headings":"","what":"modifyList for multiple lists — modifyList2","title":"modifyList for multiple lists — modifyList2","text":"calls utils::modifyList iteratively using base::Reduce, can handle >2 lists. subsequent list elements share name override previous list elements name. also handle case list NULL. Note: default keep.null = TRUE, different modifyList","code":""},{"path":"https://Require.predictiveecology.org/reference/modifyList2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"modifyList for multiple lists — modifyList2","text":"","code":"modifyList2(..., keep.null = FALSE) modifyList3(..., keep.null = TRUE)"},{"path":"https://Require.predictiveecology.org/reference/modifyList2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"modifyList for multiple lists — modifyList2","text":"... One named lists. keep.null TRUE, NULL elements val become NULL elements x. Otherwise, corresponding element, present, deleted x.","code":""},{"path":"https://Require.predictiveecology.org/reference/modifyList2.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"modifyList for multiple lists — modifyList2","text":"less convenience around Reduce(modifyList, list(...)), checks, addition keep.null = TRUE default.","code":""},{"path":"https://Require.predictiveecology.org/reference/modifyList2.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"modifyList for multiple lists — modifyList2","text":"modifyList3 retains original behaviour modifyList2 (prior Oct 2022); however, retain NULL values lists.","code":""},{"path":"https://Require.predictiveecology.org/reference/modifyList2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"modifyList for multiple lists — modifyList2","text":"","code":"modifyList2(list(a = 1), list(a = 2, b = 2)) #> $a #> [1] 2 #> #> $b #> [1] 2 #> modifyList2(list(a = 1), NULL, list(a = 2, b = 2)) #> $a #> [1] 2 #> #> $b #> [1] 2 #> modifyList2( list(a = 1), list(x = NULL), list(a = 2, b = 2), list(a = 3, c = list(1:10)) ) #> $a #> [1] 3 #> #> $b #> [1] 2 #> #> $c #> $c[[1]] #> [1] 1 2 3 4 5 6 7 8 9 10 #> #>"},{"path":"https://Require.predictiveecology.org/reference/normPath.html","id":null,"dir":"Reference","previous_headings":"","what":"Normalize filepath — normPath","title":"Normalize filepath — normPath","text":"Checks specified filepath formatting consistencies: use slash instead backslash; tilde etc. expansion; remove trailing slash.","code":""},{"path":"https://Require.predictiveecology.org/reference/normPath.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Normalize filepath — normPath","text":"","code":"normPath(path) # S4 method for class 'character' normPath(path) # S4 method for class 'list' normPath(path) # S4 method for class 'NULL' normPath(path) # S4 method for class 'missing' normPath() # S4 method for class 'logical' normPath(path)"},{"path":"https://Require.predictiveecology.org/reference/normPath.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Normalize filepath — normPath","text":"path character vector filepaths.","code":""},{"path":"https://Require.predictiveecology.org/reference/normPath.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Normalize filepath — normPath","text":"Character vector cleaned filepaths.","code":""},{"path":"https://Require.predictiveecology.org/reference/normPath.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Normalize filepath — normPath","text":"","code":"## normalize file paths paths <- list(\"./aaa/zzz\", \"./aaa/zzz/\", \".//aaa//zzz\", \".//aaa//zzz/\", \".\\\\\\\\aaa\\\\\\\\zzz\", \".\\\\\\\\aaa\\\\\\\\zzz\\\\\\\\\", file.path(\".\", \"aaa\", \"zzz\")) checked <- normPath(paths) length(unique(checked)) ## 1; all of the above are equivalent #> [1] 3 ## check to see if a path exists tmpdir <- file.path(tempdir(), \"example_checkPath\") dir.exists(tmpdir) ## FALSE #> [1] FALSE tryCatch(checkPath(tmpdir, create = FALSE), error = function(e) FALSE) ## FALSE #> [1] FALSE checkPath(tmpdir, create = TRUE) #> [1] \"/tmp/RtmpimO25S/example_checkPath\" dir.exists(tmpdir) ## TRUE #> [1] TRUE unlink(tmpdir, recursive = TRUE) # clean up"},{"path":"https://Require.predictiveecology.org/reference/paddedFloatToChar.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert numeric to character with padding — paddedFloatToChar","title":"Convert numeric to character with padding — paddedFloatToChar","text":"pad floating point numbers, right left. integers, either class integer functionally integer (e.g., 1.0), pad right decimal. specific control get exact padding right left decimal, try stringi package. also rounding. See examples.","code":""},{"path":"https://Require.predictiveecology.org/reference/paddedFloatToChar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert numeric to character with padding — paddedFloatToChar","text":"","code":"paddedFloatToChar(x, padL = ceiling(log10(x + 1)), padR = 3, pad = \"0\")"},{"path":"https://Require.predictiveecology.org/reference/paddedFloatToChar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert numeric to character with padding — paddedFloatToChar","text":"x numeric. Number converted character padding padL numeric. Desired number digits left side decimal. enough, pad used pad. padR numeric. Desired number digits right side decimal. enough, pad used pad. pad character use padding (nchar(pad) == 1 must TRUE). Currently, can \"0\" \" \" (.e., space).","code":""},{"path":"https://Require.predictiveecology.org/reference/paddedFloatToChar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert numeric to character with padding — paddedFloatToChar","text":"Character string representing filename.","code":""},{"path":"https://Require.predictiveecology.org/reference/paddedFloatToChar.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Convert numeric to character with padding — paddedFloatToChar","text":"Eliot McIntire Alex Chubaty","code":""},{"path":"https://Require.predictiveecology.org/reference/paddedFloatToChar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert numeric to character with padding — paddedFloatToChar","text":"","code":"paddedFloatToChar(1.25) #> [1] \"1.250\" paddedFloatToChar(1.25, padL = 3, padR = 5) #> [1] \"001.25000\" paddedFloatToChar(1.25, padL = 3, padR = 1) # no rounding, so keeps 2 right of decimal #> [1] \"001.25\""},{"path":"https://Require.predictiveecology.org/reference/pakEnv.html","id":null,"dir":"Reference","previous_headings":"","what":"2nd level — pakEnv","title":"2nd level — pakEnv","text":"2nd level","code":""},{"path":"https://Require.predictiveecology.org/reference/pakEnv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"2nd level — pakEnv","text":"","code":"pakEnv()"},{"path":"https://Require.predictiveecology.org/reference/pkgDep.html","id":null,"dir":"Reference","previous_headings":"","what":"Reverse package depends — pkgDepTopoSort","title":"Reverse package depends — pkgDepTopoSort","text":"wrapper around tools::dependsOnPkgs, added option topoSort, sort packages top least number dependencies pkgs. essentially topological sort, done heuristically. can used e.g., detach unloadNamespace packages order dependencies detached unloaded first. pkgDep2 convenience wrapper pkgDep \"goes one level \", .e., first order dependencies, runs pkgDep . first look local filesystem (.libPaths()) use local package find dependencies. package exist locally, including whether correct version, look (currently) CRAN archives (current CRAN version desired version check). also look GitHub package description form GitHub package format account/repo@branch account/repo@commit. , attempt get package dependencies GitHub DESCRIPTION file. intended replace tools::package_dependencies pkgDep miniCRAN package, modifications allow multiple sources searched function call.","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgDep.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reverse package depends — pkgDepTopoSort","text":"","code":"pkgDepTopoSort( pkgs, deps, reverse = FALSE, topoSort = TRUE, libPaths, useAllInSearch = FALSE, returnFull = TRUE, recursive = TRUE, purge = getOption(\"Require.purge\", FALSE), which = c(\"Depends\", \"Imports\", \"LinkingTo\"), type = getOption(\"pkgType\"), verbose = getOption(\"Require.verbose\"), ... ) pkgDep2(...) pkgDep( packages, libPaths, which = c(\"Depends\", \"Imports\", \"LinkingTo\"), recursive = TRUE, depends, imports, suggests, linkingTo, repos = getOption(\"repos\"), keepVersionNumber = TRUE, includeBase = FALSE, includeSelf = TRUE, sort = TRUE, simplify = TRUE, purge = getOption(\"Require.purge\", FALSE), verbose = getOption(\"Require.verbose\"), type = getOption(\"pkgType\"), Additional_repositories = FALSE, ... )"},{"path":"https://Require.predictiveecology.org/reference/pkgDep.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reverse package depends — pkgDepTopoSort","text":"pkgs vector package names evaluate reverse depends (.e., packages use packages) deps optional named list (reverse) dependencies. supplied, tools::dependsOnPkgs(..., recursive = TRUE) used reverse Logical. TRUE, use tools::pkgDependsOn determine packages depend pkgs topoSort Logical. TRUE, default, returned list packages order least number dependencies listed pkgs top list. libPaths path search installed packages. Defaults .libPaths() useAllInSearch Logical. TRUE, non-core R packages search() appended pkgs allow also identified returnFull Logical. Primarily useful reverse = TRUE. TRUE, installed packages searched. FALSE, default, packages currently search() path passed pkgs included possible reverse dependencies. recursive Logical. dependencies dependencies searched, recursively. NOTE: Dependencies suggests recursive. Default TRUE. purge Logical. caches purged? Default getOption(\"Require.purge\", FALSE). lot internal caching results throughout Require package. help speed reduce calls internet sources. However, sometimes caches must purged. cached values renewed found old, age limit. maximum age can set seconds environment variable R_AVAILABLE_PACKAGES_CACHE_CONTROL_MAX_AGE, unset, defaults 3600 (one hour – see utils::available.packages). Internally, calls available.packages. character vector listing types dependencies, subset c(\"Depends\", \"Imports\", \"LinkingTo\", \"Suggests\", \"Enhances\"). Character string \"\" shorthand vector, character string \"\" vector without \"Enhances\". type See utils::install.packages verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility). ... Currently dependencies alternative . specified, ignored. packages Either character vector packages install via install.packages, load (.e., library), , convenience, vector list (using c list) unquoted package names install /load (require, vectorized). Passing vectors names may work cases, user confirm relying behaviour operational code. case GitHub package, assumed name repository name package. case, pass named character vector , names package names different GitHub repository name. depends Logical. Include packages listed \"Depends\". Default TRUE. imports Logical. Include packages listed \"Imports\". Default TRUE. suggests Logical. Include packages listed \"Suggests\". Default FALSE. linkingTo Logical. Include packages listed \"LinkingTo\". Default TRUE. repos remote repository (e.g., CRAN mirror), passed either install.packages, install_github installVersions. keepVersionNumber Logical. TRUE, package dependencies returned include version number. Default FALSE includeBase Logical. R base packages included, specifically, tail(.libPaths(), 1) includeSelf Logical. TRUE, default, dependencies include package returned list elements, otherwise, \"dependencies\" sort Logical. TRUE, default, packages sorted alphabetically. FALSE, packages discernible order concatenation possibly recursive package dependencies. simplify Logical numeric. TRUE (> 0), default, return object \"just\" character vector package names (version requirements). FALSE (0), data.table returned 4 columns, Package, packageFullName, parentPackage (package name given line entry dependency; \"user\" user supplied) deps, list data.tables dependencies. negative number, return similar data.table FALSE, however, duplications recursive package dependencies left intact. Additional_repositories Logical. TRUE, pkgDep return list data.table objects (instead character vectors) column packageFullName possibly second column Additional_repositories, may specified DESCRIPTION file. NOTE: ALTERS OUTPUT CLASS","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgDep.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reverse package depends — pkgDepTopoSort","text":"possibly ordered, named (packages names) list list elements either full reverse depends.","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgDep.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Reverse package depends — pkgDepTopoSort","text":"tools::package_dependencies pkgDep differ following circumstances: GitHub packages detected using tools::package_dependencies; tools::package_dependencies detect dependencies base packages among , e.g., methods depends stats graphics.","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgDep.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reverse package depends — pkgDepTopoSort","text":"","code":"if (FALSE) { # \\dontrun{ if (Require:::.runLongExamples()) { opts <- Require:::.setupExample() pkgDepTopoSort(c(\"Require\", \"data.table\"), reverse = TRUE) Require:::.cleanup(opts) } } # } if (FALSE) { # \\dontrun{ if (Require:::.runLongExamples()) { opts <- Require:::.setupExample() pkgDep2(\"reproducible\") # much bigger one pkgDep2(\"tidyverse\") Require:::.cleanup(opts) } } # } if (FALSE) { # \\dontrun{ if (Require:::.runLongExamples()) { opts <- Require:::.setupExample() pkgDep(\"tidyverse\", recursive = TRUE) # GitHub, local, and CRAN packages pkgDep(c(\"PredictiveEcology/reproducible\", \"Require\", \"plyr\")) Require:::.cleanup(opts) } } # }"},{"path":"https://Require.predictiveecology.org/reference/pkgDepEnv.html","id":null,"dir":"Reference","previous_headings":"","what":"2nd level — pkgDepEnv","title":"2nd level — pkgDepEnv","text":"2nd level","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgDepEnv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"2nd level — pkgDepEnv","text":"","code":"pkgDepEnv()"},{"path":"https://Require.predictiveecology.org/reference/pkgDepIfDepRemoved.html","id":null,"dir":"Reference","previous_headings":"","what":"Package dependencies when one or more packages removed — pkgDepIfDepRemoved","title":"Package dependencies when one or more packages removed — pkgDepIfDepRemoved","text":"primarily package developers. allows testing recursive dependencies package removed immediate dependencies.","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgDepIfDepRemoved.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Package dependencies when one or more packages removed — pkgDepIfDepRemoved","text":"","code":"pkgDepIfDepRemoved( pkg = character(), depsRemoved = character(), verbose = getOption() )"},{"path":"https://Require.predictiveecology.org/reference/pkgDepIfDepRemoved.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Package dependencies when one or more packages removed — pkgDepIfDepRemoved","text":"pkg package name testing dependencies depsRemoved vector package names \"removed\" pkg immediate dependencies verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgDepIfDepRemoved.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Package dependencies when one or more packages removed — pkgDepIfDepRemoved","text":"list 3 named lists Direct, Recursive IfRemoved. Direct show top level direct dependencies, either Remaining Removed. Recursive show full recursive dependencies, either Remaining Removed. IfRemoved returns package dependencies removed top level dependency. top level dependency listed final list, means also recursive dependency elsewhere, removal effect.","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgDepIfDepRemoved.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Package dependencies when one or more packages removed — pkgDepIfDepRemoved","text":"","code":"if (FALSE) { # \\dontrun{ if (Require:::.runLongExamples()) { opts <- Require:::.setupExample() pkgDepIfDepRemoved(\"reproducible\", \"data.table\") Require:::.cleanup(opts) } } # }"},{"path":"https://Require.predictiveecology.org/reference/pkgSnapshot.html","id":null,"dir":"Reference","previous_headings":"","what":"Take a snapshot of all the packages and version numbers — pkgSnapshot","title":"Take a snapshot of all the packages and version numbers — pkgSnapshot","text":"can used later Require install re-install correct versions. See examples.","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgSnapshot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Take a snapshot of all the packages and version numbers — pkgSnapshot","text":"","code":"pkgSnapshot( packageVersionFile = getOption(\"Require.packageVersionFile\"), libPaths = .libPaths(), standAlone = FALSE, purge = getOption(\"Require.purge\", FALSE), exact = TRUE, includeBase = FALSE, verbose = getOption(\"Require.verbose\") ) pkgSnapshot2( packageVersionFile = getOption(\"Require.packageVersionFile\"), libPaths, standAlone = FALSE, purge = getOption(\"Require.purge\", FALSE), exact = TRUE, includeBase = FALSE, verbose = getOption(\"Require.verbose\") )"},{"path":"https://Require.predictiveecology.org/reference/pkgSnapshot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Take a snapshot of all the packages and version numbers — pkgSnapshot","text":"packageVersionFile filename save packages currently installed version numbers. Defaults \"packageVersions.txt\". specified NULL, function return exact Require call needed install packages current versions. can useful add script allow reproducibility script. libPaths path local library packages installed. Defaults .libPaths()[1]. standAlone Logical. TRUE, packages installed loaded libPaths . NOTE: TRUE, CHANGE USER'S .libPaths(), similar e.g., checkpoint package. FALSE, libPath prepended .libPaths() Require call, resulting shared packages, .e., include user's default package folder(s). can create dramatically faster installs user substantial number packages already personal library. Default FALSE minimize package installing. purge Logical. caches purged? Default getOption(\"Require.purge\", FALSE). lot internal caching results throughout Require package. help speed reduce calls internet sources. However, sometimes caches must purged. cached values renewed found old, age limit. maximum age can set seconds environment variable R_AVAILABLE_PACKAGES_CACHE_CONTROL_MAX_AGE, unset, defaults 3600 (one hour – see utils::available.packages). Internally, calls available.packages. exact Logical. TRUE, default, GitHub packages, install exact SHA, rather head account/repo@branch. CRAN packages, install exact version. FALSE, GitHub packages identify branch specified upon installation, SHA. package installed reference SHA, return SHA know branch came . Similarly, CRAN packages report version specify >=, allowing subsequent user install minimum version number, opposed exact version number. includeBase Logical. R base packages included, specifically, tail(.libPaths(), 1) verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgSnapshot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Take a snapshot of all the packages and version numbers — pkgSnapshot","text":"write file, (invisibly) return vector packages version numbers. vector can used directly Require, though likely used require = FALSE prevent attaching packages.","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgSnapshot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Take a snapshot of all the packages and version numbers — pkgSnapshot","text":"file written package names versions packages within libPaths. can later passed Require. pkgSnapshot2 returns vector package names versions, file output. See examples.","code":""},{"path":"https://Require.predictiveecology.org/reference/pkgSnapshot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Take a snapshot of all the packages and version numbers — pkgSnapshot","text":"","code":"if (FALSE) { # \\dontrun{ if (Require:::.runLongExamples()) { opts <- Require:::.setupExample() # install one archived version so that below does something interesting libForThisEx <- tempdir2(\"Example\") Require(\"crayon (==1.5.1)\", libPaths = libForThisEx, require = FALSE) # Normal use -- using the libForThisEx for example; # normally libPaths would be omitted to get all # packages in user or project library tf <- tempfile() # writes to getOption(\"Require.packageVersionFile\") # within project; also returns a vector # of packages with version pkgs <- pkgSnapshot( packageVersionFile = tf, libPaths = libForThisEx, standAlone = TRUE # only this library ) # Now move this file to another computer e.g. by committing in git, # emailing, googledrive # on next computer/project Require(packageVersionFile = tf, libPaths = libForThisEx) # Using pkgSnapshot2 to get the vector of packages and versions pkgs <- pkgSnapshot2( libPaths = libForThisEx, standAlone = TRUE ) Install(pkgs) # will install packages from previous line Require:::.cleanup(opts) unlink(getOption(\"Require.packageVersionFile\")) } } # }"},{"path":"https://Require.predictiveecology.org/reference/rmBase.html","id":null,"dir":"Reference","previous_headings":"","what":"Recursive function to remove .basePkgs — rmBase","title":"Recursive function to remove .basePkgs — rmBase","text":"Recursive function remove .basePkgs","code":""},{"path":"https://Require.predictiveecology.org/reference/rmBase.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Recursive function to remove .basePkgs — rmBase","text":"","code":"rmBase(includeBase = formals(pkgDep)[[\"includeBase\"]], deps)"},{"path":"https://Require.predictiveecology.org/reference/rmBase.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Recursive function to remove .basePkgs — rmBase","text":"includeBase Logical. FALSE, default, base packages removed. deps Either list dependencies, data.table dependencies column Package vector dependencies.","code":""},{"path":"https://Require.predictiveecology.org/reference/rversions.html","id":null,"dir":"Reference","previous_headings":"","what":"R versions — rversions","title":"R versions — rversions","text":"Reference table R versions release dates (2018 later).","code":""},{"path":"https://Require.predictiveecology.org/reference/rversions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"R versions — rversions","text":"","code":"rversions"},{"path":"https://Require.predictiveecology.org/reference/rversions.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"R versions — rversions","text":"object class data.frame 21 rows 2 columns.","code":""},{"path":"https://Require.predictiveecology.org/reference/rversions.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"R versions — rversions","text":"Update needed using rversions::r_versions(): # install.packages(\"rversions\") v = rversions::r_versions() keep = (.Date(v$date, format = \" .Date(\"2018-01-01\", format = \" dput(v[keep, c(\"version\", \"date\")])","code":""},{"path":"https://Require.predictiveecology.org/reference/setLibPaths.html","id":null,"dir":"Reference","previous_headings":"","what":"Set .libPaths — setLibPaths","title":"Set .libPaths — setLibPaths","text":"set .libPaths() either adding new path standAlone = FALSE, concatenate c(libPath, tail(.libPaths(), 1)) standAlone = TRUE. Currently, default make new .libPaths() \"sticky\", meaning becomes associated current directory even restart R. adding /updating .Rprofile file current directory. current directory project, project new .libPaths() associated , even R restart.","code":""},{"path":"https://Require.predictiveecology.org/reference/setLibPaths.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set .libPaths — setLibPaths","text":"","code":"setLibPaths( libPaths, standAlone = TRUE, updateRprofile = getOption(\"Require.updateRprofile\", FALSE), exact = FALSE, verbose = getOption(\"Require.verbose\") )"},{"path":"https://Require.predictiveecology.org/reference/setLibPaths.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set .libPaths — setLibPaths","text":"libPaths new path append , replace existing user components .libPath() standAlone Logical. TRUE, packages installed loaded libPaths . NOTE: TRUE, CHANGE USER'S .libPaths(), similar e.g., checkpoint package. FALSE, libPath prepended .libPaths() Require call, resulting shared packages, .e., include user's default package folder(s). can create dramatically faster installs user substantial number packages already personal library. Default FALSE minimize package installing. updateRprofile Logical Character string. TRUE, function put several lines code current directory's .Rprofile file setting package libraries future sessions. character string, path .Rprofile file. reset back normal, run setLibPaths() without libPath. Default: getOption(\"Require.updateRprofile\", FALSE), meaning FALSE, can set option within single call. exact Logical. function automatically append R version number libPaths maintain separate R package libraries R version system. cases behaviour desirable. Set exact TRUE override automatic appending use exact, unaltered libPaths. Default FALSE verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/setLibPaths.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set .libPaths — setLibPaths","text":"main point function set .libPaths(), changed side effect function. setting options, return previous state .libPaths() allowing user reset easily.","code":""},{"path":"https://Require.predictiveecology.org/reference/setLibPaths.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set .libPaths — setLibPaths","text":"details code modified https://github.com/milesmcbain. different, likely non-approved CRAN approach also works : https://stackoverflow.com//36873741/3890027.","code":""},{"path":"https://Require.predictiveecology.org/reference/setLibPaths.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set .libPaths — setLibPaths","text":"","code":"if (FALSE) { # \\dontrun{ if (Require:::.runLongExamples()) { opts <- Require:::.setupExample() origDir <- setwd(tempdir()) td <- tempdir() setLibPaths(td) # set a new R package library locally setLibPaths() # reset it to original setwd(origDir) # Using standAlone = FALSE means that newly installed packages # will be installed # in the new package library, but loading packages can come # from any of the ones listed in .libPaths() # will have 2 or more paths otherLib <- file.path(td, \"newProjectLib\") setLibPaths(otherLib, standAlone = FALSE) # Can restart R, and changes will stay # remove the custom .libPaths() setLibPaths() # reset to previous; remove from .Rprofile # because libPath arg is empty Require:::.cleanup(opts) unlink(otherLib, recursive = TRUE) } } # }"},{"path":"https://Require.predictiveecology.org/reference/setLinuxBinaryRepo.html","id":null,"dir":"Reference","previous_headings":"","what":"Setup for binary Linux repositories — setLinuxBinaryRepo","title":"Setup for binary Linux repositories — setLinuxBinaryRepo","text":"Enable use binary package builds Linux RStudio Package Manager repo. set repos option, affecting current R session. put binaryLinux first position. getOption(\"repos\") NULL, put backupCRAN second position.","code":""},{"path":"https://Require.predictiveecology.org/reference/setLinuxBinaryRepo.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Setup for binary Linux repositories — setLinuxBinaryRepo","text":"","code":"setLinuxBinaryRepo( binaryLinux = urlForArchivedPkgs, backupCRAN = srcPackageURLOnCRAN )"},{"path":"https://Require.predictiveecology.org/reference/setLinuxBinaryRepo.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Setup for binary Linux repositories — setLinuxBinaryRepo","text":"binaryLinux CRAN repository serving binary Linux packages. backupCRAN CRAN repository set","code":""},{"path":"https://Require.predictiveecology.org/reference/setdiffNamed.html","id":null,"dir":"Reference","previous_headings":"","what":"Like setdiff, but takes into account names — setdiffNamed","title":"Like setdiff, but takes into account names — setdiffNamed","text":"identify elements l1 l2. missingFill provided, elements l2, l1 returned, assigning missingFill values. might NULL \"\", .e., sort empty value. function work named lists, named vectors likely named classes.","code":""},{"path":"https://Require.predictiveecology.org/reference/setdiffNamed.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Like setdiff, but takes into account names — setdiffNamed","text":"","code":"setdiffNamed(l1, l2, missingFill)"},{"path":"https://Require.predictiveecology.org/reference/setdiffNamed.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Like setdiff, but takes into account names — setdiffNamed","text":"l1 named list named vector l2 named list named vector (must class l1) missingFill value, NULL \"\" \"missing\" given elements returned, l2, l1","code":""},{"path":"https://Require.predictiveecology.org/reference/setdiffNamed.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Like setdiff, but takes into account names — setdiffNamed","text":"vector list elements l1 l2, optionally elements l2 l1, values set missingFill","code":""},{"path":"https://Require.predictiveecology.org/reference/setdiffNamed.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Like setdiff, but takes into account names — setdiffNamed","text":"3 types differences might occur named elements: 1. new named element, 2. removed named element, 3. modified named element. function captures . case unnamed elements, e.g., setdiff, first two seen differences, values different.","code":""},{"path":"https://Require.predictiveecology.org/reference/setup.html","id":null,"dir":"Reference","previous_headings":"","what":"Setup a project library, cache, options — setup","title":"Setup a project library, cache, options — setup","text":"setup setupOff currently deprecated. may re-created future version. place, user can simply put .libPaths(libs, include.site = FALSE) .Rprofile file, libs directory packages installed folder R version number, e.g., derived using checkLibPaths(libs).","code":""},{"path":"https://Require.predictiveecology.org/reference/setup.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Setup a project library, cache, options — setup","text":"","code":"setup( newLibPaths, RPackageFolders, RPackageCache = cacheGetOptionCachePkgDir(), standAlone = getOption(\"Require.standAlone\", TRUE), verbose = getOption(\"Require.verbose\") ) setupOff(removePackages = FALSE, verbose = getOption(\"Require.verbose\"))"},{"path":"https://Require.predictiveecology.org/reference/setup.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Setup a project library, cache, options — setup","text":"newLibPaths RPackageFolders. consistent naming Require(..., libPaths = ...). RPackageFolders One folders R packages installed loaded . case one folder provided, installation happen first one. RPackageCache See ?RequireOptions. standAlone Logical. TRUE, packages installed loaded libPaths . NOTE: TRUE, CHANGE USER'S .libPaths(), similar e.g., checkpoint package. FALSE, libPath prepended .libPaths() Require call, resulting shared packages, .e., include user's default package folder(s). can create dramatically faster installs user substantial number packages already personal library. Default FALSE minimize package installing. verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility). removePackages Deprecated. Please remove packages manually .libPaths()","code":""},{"path":"https://Require.predictiveecology.org/reference/sourcePkgs.html","id":null,"dir":"Reference","previous_headings":"","what":"A list of R packages that should likely be installed from Source, not Binary — sourcePkgs","title":"A list of R packages that should likely be installed from Source, not Binary — sourcePkgs","text":"list R packages Require installs source Linux, even getOptions(\"repos\") binary repository. list can updated user modifying options Require.spatialPkgs Require.otherPkgs. Default \"force source packages\" visible RequireOptions().","code":""},{"path":"https://Require.predictiveecology.org/reference/sourcePkgs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A list of R packages that should likely be installed from Source, not Binary — sourcePkgs","text":"","code":"sourcePkgs(additional = NULL, spatialPkgs = NULL, otherPkgs = NULL)"},{"path":"https://Require.predictiveecology.org/reference/sourcePkgs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A list of R packages that should likely be installed from Source, not Binary — sourcePkgs","text":"additional packages added 2 argument vectors spatialPkgs character vector package names focus spatial analyses. otherPkgs character vector package names often require system specific compilation.","code":""},{"path":"https://Require.predictiveecology.org/reference/sourcePkgs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"A list of R packages that should likely be installed from Source, not Binary — sourcePkgs","text":"sorted concatenation 3 input parameters.","code":""},{"path":"https://Require.predictiveecology.org/reference/splitKeepOrderAndDTIntegrity.html","id":null,"dir":"Reference","previous_headings":"","what":"split for a data.table that keeps integrity of a column of lists of data.table objects — splitKeepOrderAndDTIntegrity","title":"split for a data.table that keeps integrity of a column of lists of data.table objects — splitKeepOrderAndDTIntegrity","text":"data.table::split 2 bad things: reorders using f destroys integrity column list data.tables, using , keep order, need , keep integrity, need f. function","code":""},{"path":"https://Require.predictiveecology.org/reference/splitKeepOrderAndDTIntegrity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"split for a data.table that keeps integrity of a column of lists of data.table objects — splitKeepOrderAndDTIntegrity","text":"","code":"splitKeepOrderAndDTIntegrity(pkgDT, splitOn)"},{"path":"https://Require.predictiveecology.org/reference/splitKeepOrderAndDTIntegrity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"split for a data.table that keeps integrity of a column of lists of data.table objects — splitKeepOrderAndDTIntegrity","text":"pkgDT pkgDT object e.g., toPkgDT splitOn Character vector passed data.table::split(..., f = splitOn)","code":""},{"path":"https://Require.predictiveecology.org/reference/splitKeepOrderAndDTIntegrity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"split for a data.table that keeps integrity of a column of lists of data.table objects — splitKeepOrderAndDTIntegrity","text":"list data.table objects length(unique(splitOn)).","code":""},{"path":"https://Require.predictiveecology.org/reference/sysInstallAndDownload.html","id":null,"dir":"Reference","previous_headings":"","what":"download.files or install.packages in a separate process — sysInstallAndDownload","title":"download.files or install.packages in a separate process — sysInstallAndDownload","text":"uses sys package messaging can controlled. also provides option parallelize spawning multiple background process allow parallel e.g., downloads. Noting libcurl installed (detected using capabilities(\"libcurl\")), explicit parallelism allowed, instead method = \"libcurl\" passed enabling parallel downloads.","code":""},{"path":"https://Require.predictiveecology.org/reference/sysInstallAndDownload.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"download.files or install.packages in a separate process — sysInstallAndDownload","text":"","code":"sysInstallAndDownload( args, splitOn = \"pkgs\", doLine = \"outfiles <- do.call(download.packages, args)\", returnOutfile = FALSE, doLineVectorized = TRUE, tmpdir, libPaths, verbose )"},{"path":"https://Require.predictiveecology.org/reference/sysInstallAndDownload.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"download.files or install.packages in a separate process — sysInstallAndDownload","text":"args list arguments .call either download.file, install.packagesor custom function e.g.,downloadAndBuildToLocalFile`. splitOn character vector names args parallelize . Defaults pkgs. named elements args assumed length 1 used every parallel process. doLine character string \"outfiles <- .call(..., args)\" line. returnOutfile logical. TRUE, names outfiles returned. doLineVectorized logical. TRUE, parallism used, indicates doLine function allows multiple elements args[[splitOn[[1]]]. FALSE, function make multiple sequential calls within parallel process doLine call. tmpdir single path downloads put libPaths library path (libraries) packages installed, looked load (.e., call library). can used create isolated, stand alone package installations, used standAlone = TRUE. Currently, path supplied prepended .libPaths() (temporarily call) Require standAlone = FALSE set (temporarily) .libPaths() c(libPaths, tail(libPaths(), 1) keep base packages. verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/sysInstallAndDownload.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"download.files or install.packages in a separate process — sysInstallAndDownload","text":"Mostly side effects, namely installed packages downloaded packages files. However, case returnOutfile = TRUE, list filenames returned outputs doLine.","code":""},{"path":"https://Require.predictiveecology.org/reference/tempdir2.html","id":null,"dir":"Reference","previous_headings":"","what":"Make a temporary (sub-)directory — tempdir2","title":"Make a temporary (sub-)directory — tempdir2","text":"Create temporary subdirectory .RequireTempPath(), temporary file temporary subdirectory.","code":""},{"path":"https://Require.predictiveecology.org/reference/tempdir2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make a temporary (sub-)directory — tempdir2","text":"","code":"tempdir2( sub = \"\", tempdir = getOption(\"Require.tempPath\", .RequireTempPath()), create = TRUE )"},{"path":"https://Require.predictiveecology.org/reference/tempdir2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make a temporary (sub-)directory — tempdir2","text":"sub Character string, length 1. Can result file.path(\"smth\", \"smth2\") nested temporary sub directories. tempdir Optional character string temporary dir placed. Defaults .RequireTempPath() create Logical. directory created. Default TRUE","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/reference/tempfile2.html","id":null,"dir":"Reference","previous_headings":"","what":"Make a temporary subfile in a temporary (sub-)directory — tempfile2","title":"Make a temporary subfile in a temporary (sub-)directory — tempfile2","text":"Make temporary subfile temporary (sub-)directory","code":""},{"path":"https://Require.predictiveecology.org/reference/tempfile2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make a temporary subfile in a temporary (sub-)directory — tempfile2","text":"","code":"tempfile2( sub = \"\", tempdir = getOption(\"Require.tempPath\", .RequireTempPath()), ... )"},{"path":"https://Require.predictiveecology.org/reference/tempfile2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make a temporary subfile in a temporary (sub-)directory — tempfile2","text":"sub Character string, length 1. Can result file.path(\"smth\", \"smth2\") nested temporary sub directories. tempdir Optional character string temporary dir placed. Defaults .RequireTempPath() ... passed tempfile, e.g., fileext","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/reference/trimVersionNumber.html","id":null,"dir":"Reference","previous_headings":"","what":"Trim version number off a compound package name — trimVersionNumber","title":"Trim version number off a compound package name — trimVersionNumber","text":"resulting string(s) name (including github.com repository exists).","code":""},{"path":"https://Require.predictiveecology.org/reference/trimVersionNumber.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Trim version number off a compound package name — trimVersionNumber","text":"","code":"trimVersionNumber(pkgs)"},{"path":"https://Require.predictiveecology.org/reference/trimVersionNumber.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Trim version number off a compound package name — trimVersionNumber","text":"pkgs character string vector packages without GitHub path versions","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/reference/trimVersionNumber.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Trim version number off a compound package name — trimVersionNumber","text":"","code":"trimVersionNumber(\"PredictiveEcology/Require (<=0.0.1)\") #> [1] \"PredictiveEcology/Require\""},{"path":"https://Require.predictiveecology.org/reference/updatePackages.html","id":null,"dir":"Reference","previous_headings":"","what":"Update installed packages with latest available versions — updatePackages","title":"Update installed packages with latest available versions — updatePackages","text":"Similar update.packages, works archived, non-archived, Github packages.","code":""},{"path":"https://Require.predictiveecology.org/reference/updatePackages.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update installed packages with latest available versions — updatePackages","text":"","code":"updatePackages( libPaths = .libPaths()[1], purge = FALSE, verbose = getOption(\"Require.verbose\") )"},{"path":"https://Require.predictiveecology.org/reference/updatePackages.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update installed packages with latest available versions — updatePackages","text":"libPaths library update; defaults .libPaths()[1] purge Logical. assessment installed.packages purge cached version. Default FALSE verbose Numeric logical indicating verbose function . -1 -2, little verbosity possible. 0 FALSE, minimal outputs; 1 TRUE, outputs; 2 even . NOTE: Require function, verbose >= 2, also returns details returnDetails = TRUE (backwards compatibility).","code":""},{"path":"https://Require.predictiveecology.org/reference/updatePackages.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Update installed packages with latest available versions — updatePackages","text":"Run side effect, namely, updating installed packages latest possible state, whether CRAN currently, archived, GitHub.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-100","dir":"Changelog","previous_headings":"","what":"version 1.0.0","title":"version 1.0.0","text":"CRAN release: 2024-07-27","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"major-changes-1-0-0","dir":"Changelog","previous_headings":"","what":"major changes","title":"version 1.0.0","text":"Installation, package downloading, package building source now occur external process using sys package. allows control messaging installations, also allows installation many packages already loaded (message session need restarting). can turned turned option(Require.installPackagesSys = FALSE). internals pkgDep changed. new algorithms faster reliable, far fewer lines code. testing converted using testit using testthat. change adds many dependencies Suggests, benefits, e.g., using withr control loading unloading options, packages etc., outweigh drawbacks.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-1-0-0","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 1.0.0","text":"packages argument Require Install can now unquoted names length == 1 length > 1 using c() list(), addition character string, e.g., Install(ggplot2); Now, GitHub.com package field Additional_repositories DESCRIPTION file, Require search packages find repos argument. affect CRAN packages, information contained within available.packages() data base, used identify dependencies, rather reading DESCRIPTION file individually; verbose now propagates better internal functions, e.g., verbose = -2 make installing silent; Better automatic cleaning Cached packages corrupt; experimental use pak backend installer packages instead install.packages. user can attempt use backend options(Require.usePak = TRUE). number cases (specifically needing exact versions) work; “normal” package installations widely tested. pak backend tends similar speed first installations, much slower subsequent calls Install/Require; Better recovery installation failures e.g., local cached copy corrupt, automatically cleaned; Require.Rmd vignette “Getting Started” new; many speed enhancements cases e.g., download necessary; downloads GitHub.com done, Require now uses gitcreds get git credentials httr download files token;","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"function-name-changes-1-0-0","dir":"Changelog","previous_headings":"","what":"Function name changes","title":"version 1.0.0","text":"functions related cache now start cache, e.g., cacheClearPackages replaces clearRequirePackageCache. Previous names kept backwards compatibility.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfixes-1-0-0","dir":"Changelog","previous_headings":"","what":"bugfixes","title":"version 1.0.0","text":"GitHub packages attempted installed, failed package already loaded session, Require incorrectly think successfully installed (#87); Warning occurred package longer CRAN user supplied multiple repos getOption('repos'). result unaffected warning, warning now removed; allow user-specified path pkgSnapshot() (#93); number new cases added tests previously hit errors; many small bugs fixed; issues specific MacOS fixed. fixes implemented issues #91, #96, #97, #102, #105","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-031","dir":"Changelog","previous_headings":"","what":"version 0.3.1","title":"version 0.3.1","text":"CRAN release: 2023-05-22","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-0-3-1","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 0.3.1","text":"minor modifications internet available deal edge cases package snapshots internally consistent, .e., violate package versions, skip missing branches GitHub, needed (#81).","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfixes-0-3-1","dir":"Changelog","previous_headings":"","what":"bugfixes","title":"version 0.3.1","text":"updates tests begun fail","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-030","dir":"Changelog","previous_headings":"","what":"version 0.3.0","title":"version 0.3.0","text":"CRAN release: 2023-03-14","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-0-3-0","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 0.3.0","text":"Moved MRAN archives binaries https://packagemanager.posit.co/ move MRAN posit package manager, attempts made use archived binary packages Linux also. improved messaging several places improved error catching several places number cases annoying users identified addressed. setupOff setLibPaths enhanced fully functioning wide diversity cases. setting install = \"force\" Require, now user-specified packages forced installed; rest installed required, mimicking install.packages small efficiency gains many places (HEAD) now robust way keep package date.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"advanced-changes-0-3-0","dir":"Changelog","previous_headings":"","what":"advanced changes","title":"version 0.3.0","text":"several functions now exported, .downloadFileMasterMainAuth, messageVerbose, messageDF deemed useful enough packages.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfixes-0-3-0","dir":"Changelog","previous_headings":"","what":"bugfixes","title":"version 0.3.0","text":"slow assessment package dependencies CRAN packages stale available.packagesCached() object. Now, catches condition refreshes available.packages() corrected support multiple repos offer packages. Now works like install.packages, .e., first one first. base packages can now installed previous issues installing dealt .","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-026","dir":"Changelog","previous_headings":"","what":"version 0.2.6","title":"version 0.2.6","text":"CRAN release: 2023-01-05","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-0-2-6","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 0.2.6","text":"attempts deal cases failed installations Install install argument; now introduced, allowing (likely) use case Install(pkg, install = \"force\") examples now use Install often Require(..., require = FALSE) simplicity.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"improved-messaging-0-2-6","dir":"Changelog","previous_headings":"","what":"improved messaging","title":"version 0.2.6","text":"non-interactive CRAN mirror set, user gets informative error.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfixes-0-2-6","dir":"Changelog","previous_headings":"","what":"bugfixes","title":"version 0.2.6","text":"Cases multiple user-specified .libPaths() treated incorrectly; now respected. git repo installed identical SHA already installed, loaded, thinking failed install; fixed can now deal case repos multiple, non-binary CRAN-like repositories, also least one binary repository supplied e.g., rstudio package manager, .e., least 3 repositories supplied, 1 binary. minor","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-025","dir":"Changelog","previous_headings":"","what":"version 0.2.5","title":"version 0.2.5","text":"CRAN release: 2022-11-24","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-0-2-5","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 0.2.5","text":"several modifications enable CRAN-policy violations addressed, notably keeping temporary (package personal) cache directories clean examples tests major overhaul inner workings Require. now downloads builds Archive GitHub packages prior installation, installs packages (CRAN, Archive, GitHub, MRAN Windows) one install.packages call (Linux-alikes) two install.packages calls (binary source), allowing efficient parallel installs. results fast installs combinations packages. new options(\"Require.offlineMode\") can set FALSE stop Require pkgDep checking internet. fail, unless cached packages available locally (.e., run packages installed previously). , installed without needing internet. option also set automatically first attempt get file internet, fails, triggering test internet. fails, option set FALSE next call Require pkgDep reset. experimental still. many edge cases found dealt experimental use (HEAD) keep package “date” HEAD GitHub branch. behaviour still uses version numbering, update based SHA, HEAD ahead locally installed package (HEAD) specified, update. Specifically, use instead version number, e.g., \"PredictiveEcology/Require@development (HEAD)\" modifyList2 now follows modifyList adding keep.null argument. setdiffNamed compare 2 named lists vectors keep elements first list (vector), keeping mind name well element. package messaging sorted alphabetically installation message calls now messageVerbose, verbosity can fully controlled argument verbose options(\"Require.verbose\"). See ?RequireOptions. tests clean completely options(Require.cachePkgDir = FALSE) (environment variable \"R_REQUIRE_PKGCACHE\"), cache folder created; previously nearly empty folder created default. See ?RequireOptions Remove option Require.persistentPkgEnv deemed superfluous. numerous enhancements speed new function Install, Require(..., require = FALSE) (HEAD) now tested CRAN repositories works expected. Updated README show new functionality attempt use local cached packages crancache user sets options(Require.useCranCache = TRUE). experimental still tested. new function, clearRequirePackageCache, clearing package cache. cache developed able shared across Operating Systems, shared file system. GitHub packages require SHA assessed; now Cached disk well RAM, persists even R restart. non-package cache files (available.packages, pkgDep, GitHubSHA) refreshed (purged) every 1 hour. Much improved messaging, including identifying MRAN package installs explicitly (instead just “Archive”)","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfixes-0-2-5","dir":"Changelog","previous_headings":"","what":"bugfixes","title":"version 0.2.5","text":"pkgDep using local DESCRIPTION file establish package dependencies package, available. local package ahead CRAN (developer’s case), desirable. , local installed version behind CRAN (common user’s case), desirable. pkgDep now uses CRAN’s version (using available.packages) developers can handle situation . several minor bugfix defaultCacheDir, default runneradmin conditions allow installing packages due permissions.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"deprecated-0-2-5","dir":"Changelog","previous_headings":"","what":"deprecated","title":"version 0.2.5","text":"setup setupOff now deprecated; messaging supplied used several options deprecated","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-0-1-6","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 0.1.6","text":"pkgSnapshot examples brought present usage & simplified pkgSnapshot now uses default filename option Require.packageVersionFile. Require can now accept packageVersionFile = TRUE, meaning use package version file set Require.packageVersionFile option.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfix-0-1-6","dir":"Changelog","previous_headings":"","what":"bugfix","title":"version 0.1.6","text":"minor bugfix detected submission CRAN","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-0-1-5","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 0.1.5","text":"package caching packages need sources installs (.e., identified sourcePkgs(), tend occur R packages require idiosyncratic system dependencies) cache binary version reuse system subsequent re-installs.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfix-0-1-5","dir":"Changelog","previous_headings":"","what":"bugfix","title":"version 0.1.5","text":"pkgDep misidentifying correct package dependencies. manifest user version package “” installed well dependencies, e.g., “B”. user updated “” new version required new version “B”, correctly identify new dependency requirement, update “B”, causing “” update fail. fixed.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-014","dir":"Changelog","previous_headings":"","what":"version 0.1.4","title":"version 0.1.4","text":"CRAN release: 2022-10-07 Make corrections 2 failing architectures CRAN MUCH less verbose automated testing","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancement-0-1-4","dir":"Changelog","previous_headings":"","what":"enhancement","title":"version 0.1.4","text":"verbose argument now widespread, -1, 0, 1, 2 valid correctly inherited values. See argument description e.g., ?Require improved warning handling","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfixes-0-1-4","dir":"Changelog","previous_headings":"","what":"bugfixes","title":"version 0.1.4","text":"edge cases found dealt ","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-012","dir":"Changelog","previous_headings":"","what":"version 0.1.2","title":"version 0.1.2","text":"CRAN release: 2022-09-23","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"dependencies-0-1-2","dir":"Changelog","previous_headings":"","what":"dependencies","title":"version 0.1.2","text":"drop support R 3.6 (R >= 4.0 supported)","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-0-1-2","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 0.1.2","text":"Require argument, require, can now character string, indicating packages attached via require Now can use GITHUB_PAT environment variable, set, accesses GitHub.com repositories (files entire repository) Attempt capture correct cases GitHub.com branches incorrectly labelled master instead main (vice versa) much quieter messaging default (can increase verbose = 1) require argument Require can now character vector indicating packages attached, just installed. Note: default, packages passed packages attached require = TRUE much faster installations: source packages, grouped installed together using internal parallelism install.packages (setting Ncpus option 4) binary, passes vectors install.packages much faster. packages installed install-safe groups speed can use pak package hood options(“Require.usepak” = TRUE), though still many cases pak deal . Users try determine option delivers expected. pak installs tend slightly faster work correctly. binary package caching turned default user-specific standard directory, making repeat installations (system, shared drive systems) much faster. MRAN installs Windows now much robust many conditions. archived packages (ie longer CRAN) now found installed (latest available version) robust dependency identification even archived older packages package versions (including dependencies) MRAN binaries used MacOSX. improved installation older packages (e.g. dependencies removed CRAN, source versions can’t easily compiled) several minor improvements package dependency resolution installation.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfixes-0-1-2","dir":"Changelog","previous_headings":"","what":"bugfixes","title":"version 0.1.2","text":"fix issue ‘dot directories’ normPath(). identified possible bug install.packages options(Ncpus = XX) XX number > 1. packages skipped. Require now captures attempts install ones get correctly installed. multiple fixes certain edge cases.","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-0-1-1","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 0.1.1","text":"can now use pak options(\"Require.usepak\" = TRUE) version specifications (.e., user specifies e.g., Require(\"reproducible (<= 1.2.9)), non-pak approach used)","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfixes-0-1-1","dir":"Changelog","previous_headings":"","what":"bugfixes","title":"version 0.1.1","text":"fixed error installing certain GitHub packages","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/news/index.html","id":"enhancements-0-1-0","dir":"Changelog","previous_headings":"","what":"enhancements","title":"version 0.1.0","text":"install CRAN packages using vectorized install.packages –> much faster now uses internal installGithubPackage instead remotes::install_github previous means installations use install.packages directly remove dependency remotes","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bugfixes-0-1-0","dir":"Changelog","previous_headings":"","what":"bugfixes","title":"version 0.1.0","text":"Require silently fail install GitHub package warning installation. warnings now correctly captured, without stopping installation. bugfix package installed GitHub directly Remotes field package Suggests (DESCRIPTION file). install Remotes package even though Suggests bugfix user supplies non-CRAN repos argument Require. correctly using. Thanks @CeresBarros identifying issue #30 bugfix “packages appear installed correctly” misreporting cases. repos argument correctly passed doInstalls Require. meant installs respect user supplied repos, use options(\"repos\") instead. extractPkgNames now allows GitHub packages repository omitted, .e., @. useful default expectation github repository better handling GitHub package install issues","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-0013","dir":"Changelog","previous_headings":"","what":"version 0.0.13","title":"version 0.0.13","text":"CRAN release: 2021-05-31 fix CRAN policy violation – dealt extraneous folder created testing","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-0012","dir":"Changelog","previous_headings":"","what":"version 0.0.12","title":"version 0.0.12","text":"CRAN release: 2021-05-26","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"dependency-changes-0-0-12","dir":"Changelog","previous_headings":"","what":"Dependency changes","title":"version 0.0.12","text":"release R 4.1, dropped support R 3.5. R 3.6 (oldrel) newer supported.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"new-features-0-0-12","dir":"Changelog","previous_headings":"","what":"New features","title":"version 0.0.12","text":"setup: new function creating new project. See readme.md setLibPath package caching (via options(\"RPackageCache\")) now automatically create use subfolder user-provided path R major & minor version number (normal R behaviour) allow multiple R versions coexist machine. setLibPaths gains new argument, updateRprofile, allows user’s changes .libPaths() persist R restart. Set getOption(\"Require.updateRprofile\", FALSE), start","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bug-fixes-0-0-12","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"version 0.0.12","text":"several edge cases complex loading many packages incorrectly () loading base packages, e.g., parallel small minor bugfixes cases DESCRIPTION file package minimum version (e.g., Imports) REMOTES: package (without minimum version, branch, say), Require use REMOTES: entry. since means minimum package version, Require automatically install package violating minimum version number, install anything. Now, harmonizes 2 entries given package, uses minimum version number git branch potential source find version number. allow either master main branches installed GitHub, without needing specify (#26) fix use options setup()","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-0010","dir":"Changelog","previous_headings":"","what":"version 0.0.10","title":"version 0.0.10","text":"CRAN release: 2020-12-02","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bug-fixes-0-0-10","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"version 0.0.10","text":"CRAN error one flavour Linux erroneous checkPath error creating Specified path xxxx exist even though .","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-009","dir":"Changelog","previous_headings":"","what":"version 0.0.9","title":"version 0.0.9","text":"CRAN release: 2020-11-30","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"new-features-0-0-9","dir":"Changelog","previous_headings":"","what":"New features","title":"version 0.0.9","text":"modifyList2, generalization utils::modifyList >2 lists. Also, can handle NULL lists. slight improvements speed internal functions detachAll now unloads reverse depends depends, loaded","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bug-fixes-0-0-9","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"version 0.0.9","text":"deals cases installing arbitrary packages packageVersion.txt file mistakenly create new, empty directory packages accommodate 2 LibPaths packageVersion.txt file, second () LibPath full base packages. Handles better false positives (packages install properly ) false negatives (error collected end error installing) better suggestion edge cases failed package installs captures deals bug install.packages (argument \"av2\" missing, default) R-devel Windows (Sept 09, 2020). May transient. , default, installing source Windows. Fixed.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-008","dir":"Changelog","previous_headings":"","what":"version 0.0.8","title":"version 0.0.8","text":"CRAN release: 2020-09-10","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"new-features-0-0-8","dir":"Changelog","previous_headings":"","what":"New features","title":"version 0.0.8","text":"GitHub SHA now stored pkgSnapshot, meaning new system can built exact versions SHAs GitHub packages. GitHub packages, now uses DESCRIPTION NAMESPACE files determine dependencies. GitHub packages generally packages state development. may include missing declarations DESCRIPTION. NAMESPACE R uses actually determine package dependencies upon installation. Now keeps binary/source package locally options(\"Require.cachePkgDir\" = \"someLocalDir\") set local folder. Currently defaults NULL, meaning local cache. Require pkgSnapshot can now understand work GitHub SHAs thus packages installed GitHub, e.g., Require(\"PredictiveEcology/Require@development\") install development version. using pkgSnapshot, exact SHA used restore package exact version Require(packageVersionFile = \"packageVersions.txt\"). package already loaded prior changing running setLibPaths, possible create version conflict. base::require error version .libPaths() older version whose namespace already loaded. accommodate , check error, newer version (already loaded) violate Require('package (versionSpecification)'), install newer version. violate version specification, error cleanly message describing possible solutions. Much better messaging reporting New function: detachAll attempts detach unload packages dependencies, reverse topological order. Speed improvements, especially pkgDep pkgDepTopoSort New function pkgDepAlt alternative pkgDep, yet easier maintain still experimental. yet workhorse inside Require, may become . Now correctly removes spaces tab characters within package version description – creating error Error: invalid version specification ' 3.3-13'","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bug-fixes-0-0-8","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"version 0.0.8","text":"pkgDepTopoSort now appears correct types package descriptions currently allowed Require, namely, packages version specification, packages version specification (including older versions), GitHub packages. many minor edge cases","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-007","dir":"Changelog","previous_headings":"","what":"version 0.0.7","title":"version 0.0.7","text":"CRAN release: 2020-08-18","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"new-features-0-0-7","dir":"Changelog","previous_headings":"","what":"New features","title":"version 0.0.7","text":"longer sets CRAN repository cloud.r-project.org even non-interactive CRAN repository set. Now uses chooseCRANmirror(ind = 1)","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bug-fixes-0-0-7","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"version 0.0.7","text":"fixes CRAN check issues Fedora.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-006","dir":"Changelog","previous_headings":"","what":"version 0.0.6","title":"version 0.0.6","text":"CRAN release: 2020-08-11","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"new-features-0-0-6","dir":"Changelog","previous_headings":"","what":"New features","title":"version 0.0.6","text":"none","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bug-fixes-0-0-6","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"version 0.0.6","text":"fixed CRAN check issues. default repo now uses option repos instead specifying CRAN repo.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-005","dir":"Changelog","previous_headings":"","what":"version 0.0.5","title":"version 0.0.5","text":"CRAN release: 2020-07-17","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"new-features-0-0-5","dir":"Changelog","previous_headings":"","what":"New features","title":"version 0.0.5","text":"moved several functions package loading installing reproducible Require, including pkgDep, pkgDepTopoSort.","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bug-fixes-0-0-5","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"version 0.0.5","text":"recursive pkgDep correctly resolve multiple instances package, different minimum version numbering. Now reports minimum version required package dependencies. minor changes non-exported functions handling bugs base::available.packages old Mac machines R versions","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-004","dir":"Changelog","previous_headings":"","what":"version 0.0.4","title":"version 0.0.4","text":"CRAN release: 2020-06-05","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"bug-fixes-0-0-4","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"version 0.0.4","text":"remove installed.packages test code, per CRAN request","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-003","dir":"Changelog","previous_headings":"","what":"version 0.0.3","title":"version 0.0.3","text":"Change title Title Case DESCRIPTION","code":""},{"path":"https://Require.predictiveecology.org/news/index.html","id":"version-002","dir":"Changelog","previous_headings":"","what":"version 0.0.2","title":"version 0.0.2","text":"Change backticks single quotes DESCRIPTION","code":""},{"path":[]},{"path":"https://Require.predictiveecology.org/news/index.html","id":"new-features-0-0-1","dir":"Changelog","previous_headings":"","what":"New features","title":"version 0.0.1","text":"rewrite function, Require (helpers) removed package reproducible function intended tool package management used within “reproducible” workflow differs attempts achieving goal trait first subsequent times function Require run, result ","code":""}]