
Identify R functions best matching a given input string
Source:R/similar-fns.R
pkgmatch_similar_fns.RdFunction matching is only available for functions from the corpus of rOpenSci packages. Function matching is also based on LM output only, and unlike package matching does not combine LM output with BM25 word-frequency matching.
Arguments
- input
A text string.
- corpus
One of "ropensci" or "bioc" (for BioConductor). It is not possible to match functions again CRAN packages.
- n
When the result of this function is printed to screen, the top
npackages will be displayed.- browse
If
TRUE, automatically open webpages of the topnmatches in local browser.
Value
A modified data.frame object of class "pkgmatch". The data.frame
has 3 columns:
"pkg_fn" with the name of the function in the form "
:: "; "simil" with a similarity score between 0 and 1; and
"rank" as an integer index, with the highest rank of 1 as the first row.
The return object has a default print method which prints the names only
of the first 5 best matching functions; see ?print.pkgmatch for details.
See also
Other main:
pkgmatch_similar_pkgs()
Examples
if (FALSE) { # \dontrun{
input <- "Process raster satellite images"
p <- pkgmatch_similar_fns (input)
p # Default print method, lists 5 best matching functions
head (p) # Shows first 5 rows of full `data.frame` object
} # }