Skip to contents

The main pkgmatch function, pkgmatch_similar_pkgs, returns data.frame objects of class "pkgmatch". This class exists primarily to enable this print method, which summarises by default the top 5 matching packages or functions. Objects can be converted to standard data.frames with as.data.frame().

Usage

# S3 method for class 'pkgmatch'
print(x, ...)

Arguments

x

Object to be printed

...

Additional parameters passed to default 'print' method.

Value

The result of printing x, in form of either a single character vector, or a named list of character vectors.

Examples

corpus <- "cran"
generate_pkgmatch_example_data (corpus = corpus)
input <- "Download open spatial data from NASA"
p <- pkgmatch_similar_pkgs (input, corpus = corpus)
head (p) # Shows first 5 rows of full `data.frame` object
#>      package version rank
#> 1      httr2   1.1.2    1
#> 2  mRpostman   1.1.4    2
#> 3      RCurl    1.98    3
#> 4 CancerGram   1.0.0    4
#> 5       curl   6.2.2    5
p # Default print method, lists 5 best matching packages
#> [1] "httr2"      "mRpostman"  "RCurl"      "CancerGram" "curl"