extractor-functions: Find packages, authors, maintainers, license, versions etc by...

extractor-functionsR Documentation

Find packages, authors, maintainers, license, versions etc by authors, packages or names matching a specific string

Description

Find packages, authors, maintainers, license, versions etc by authors, packages or names matching a specific string

Usage

## S3 method for class 'cranly_network'
package_by(x, author = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
package_with(x, name = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
author_of(x, package = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
author_with(x, name = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
suggested_by(x, package = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
suggesting(x, package = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
imported_by(x, package = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
importing(x, package = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
dependency_of(x, package = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
depending_on(x, package = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
linked_by(x, package = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
linking_to(x, package = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
enhanced_by(x, package = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
enhancing(x, package = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
maintainer_of(x, package = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
maintained_by(x, author = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
email_of(x, author = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
email_with(x, name = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
description_of(x, package = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
title_of(x, package = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
license_of(x, package = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
version_of(x, package = NULL, exact = FALSE, flat = TRUE)

## S3 method for class 'cranly_network'
release_date_of(x, package = NULL, exact = FALSE, flat = TRUE)

packages_by(x, author, exact, flat)

packages_with(x, name = NULL, exact = FALSE, flat = TRUE)

authors_with(x, name = NULL, exact = FALSE, flat = TRUE)

authors_of(x, package = NULL, exact = FALSE, flat = TRUE)

emails_of(x, author = NULL, exact = FALSE, flat = TRUE)

emails_with(x, name = NULL, exact = FALSE, flat = TRUE)

descriptions_of(x, package = NULL, exact = FALSE, flat = TRUE)

titles_of(x, package = NULL, exact = FALSE, flat = TRUE)

licenses_of(x, package = NULL, exact = FALSE, flat = TRUE)

release_dates_of(x, package = NULL, exact = FALSE, flat = TRUE)

versions_of(x, package = NULL, exact = FALSE, flat = TRUE)

Arguments

x

a cranly_network object.

author

a vector of character strings with the author names to be matched. If Inf all available authors in x are returned. If NULL (default) nothing is matched.

exact

logical. Should we use exact matching? Default is TRUE.

flat

if TRUE (default) then the result is an unnamed character vector. See Value for more details of what is returned.

name

a vector of character strings with the names to be matched. If Inf all available names in x are returned. If NULL (default) nothing is matched.

package

a vector of character strings with the package names to be matched. If Inf all available packages in x are returned. If NULL (default) nothing is matched.

Details

The extractor functions all try to figure out what y is in the statement

y is (the) extractor-function a package/author.

For example, for

  • "y is the package by "Kurt Hornik"" we do package_by(x, "Kurt Hornik")

  • "y is the author of a package with a name matching "MASS"" we do author_of(x, "MASS")

  • "y is the package enhanced by the "prediction" package we do enhanced_by(x, "prediction", exact = TRUE)

  • "y is the package linking to "Rcpp" we do linking_to(x, "Rcpp", exact = TRUE)

Value

If flat = TRUE then the result of the extraction function is a data.frame, which is the subset of x$nodes matching author, name or package (according to the value of exact). If flat = FALSE then the results is a vector.

When flat = TRUE any NAs are removed before the result is returned.

See Also

build_network.cranly_db() subset.cranly_network() plot.cranly_network()

Examples


# Using a package directives network
cran_db <- clean_CRAN_db()
package_network <- build_network(cran_db)

## Find all packages containing glm in their name
package_with(package_network, name = "glm")
## Find all authors of packages containing brglm in their name
author_of(package_network, package = "rglm", exact = FALSE)
## Find all packages with brglm in their name
package_with(package_network, name = "rglm", exact = FALSE)
## Find all authors of the package brglm2
author_of(package_network, package = "brglm2", exact = TRUE)
## Find all authors with Ioannis in their name
author_with(package_network, name = "Ioannis", exact = FALSE)
## Find all packages suggested by Rcpp
suggested_by(package_network, package = "Rcpp", exact = TRUE)
## Find all packages imported by Rcpp
imported_by(package_network, package = "Rcpp", exact = TRUE)
## Find all packages enhacing brglm
enhancing(package_network, package = "brglm", exact = TRUE)
## Find all packages linking to RcppArmadillo
linking_to(package_network, package = "RcppArmadillo", exact = TRUE)
## Find the release date of RcppArmadillo
release_date_of(package_network, package = "RcppArmadillo", exact = TRUE)
## Find the release data of all packages with "brglm" in their name
release_date_of(package_network, package = "brglm", exact = FALSE)
## More information about packages with "brglm" in their name
release_date_of(package_network, package = "brglm", exact = FALSE,
                flat = FALSE)[c("package", "version")]

## Using an author collaboration network
author_network <- build_network(cran_db, perspective = "author")
## Find all packages containing glm in their name
package_with(author_network, name = "glm")
## Find all authors of packages containing brglm in their name
author_of(author_network, package = "rglm", exact = FALSE)
## Find all packages with brglm in their name
package_with(author_network, name = "rglm", exact = FALSE)
## Find all authors of the package brglm2
author_of(author_network, package = "brglm2", exact = TRUE)
## Find all authors with Ioannis in their name
author_with(author_network, name = "Ioannis", exact = FALSE)




cranly documentation built on Aug. 27, 2022, 1:07 a.m.