FindClosestPackage: Find closest matching package

Description Usage Arguments Details Value Examples

View source: R/yearn.R

Description

Find closest matching package

Usage

1
2
3
4
FindClosestPackage(pkg, maxdist = 2, auto.select = TRUE,
  username.pref = c("cran", "ropensci", "rstudio", "tidyverse", "hadley",
  "yihui", "RcppCore", "eddelbuettel", "ropenscilabs", "hrbrmstr", "thej022214",
  "bomeara"))

Arguments

pkg

A single package

maxdist

The maximum distance that counts as a match

auto.select

If TRUE, make a best guess in case of multiple equally good

username.pref

In case of matches, user names in order of preference.

Details

Inspired by githubinstall::gh_suggest() but allows being pickier about match. The username.pref is based on my guesses on priority: "cran" is a mirror for packages that have been on CRAN at some point, but could have been taken off; "ropensci" and "rstudio" produce really useful packages, etc.

Value

pkgs that match the constraints

Examples

1
2
3
4
## Not run: 
yearn(TreEvo) # A package on github, not CRAN (yet)

## End(Not run)

yearn documentation built on Jan. 13, 2018, 1:02 a.m.