cranly (version 0.5.4)

extractor-functions: 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 cranly_network
package_by(x, author = NULL, exact = FALSE,
  flat = TRUE)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

# S3 method for 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.

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.

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)

See Also

build_network.cranly_db subset.cranly_network plot.cranly_network

Examples

Run this code
# NOT RUN {
# Using a package directives network
cran_db <- clean_CRAN_db()
pkg_net <- build_network(cran_db, perspective = "package")
## Find all packages containing glm in their name
package_with(pkg_net, name = "glm")
## Find all authors of packages containing brglm in their name
author_of(pkg_net, package = "rglm", exact = FALSE)
## Find all packages with brglm in their name
package_with(pkg_net, name = "rglm", exact = FALSE)
## Find all authors of the package brglm2
author_of(pkg_net, package = "brglm2", exact = TRUE)
## Find all authors with Ioannis in their name
author_with(pkg_net, name = "Ioannis", exact = FALSE)
## Find all packages suggested by Rcpp
suggested_by(pkg_net, package = "Rcpp", exact = TRUE)
## Find all packages imported by Rcpp 
imported_by(pkg_net, package = "Rcpp", exact = TRUE)
## Find all packages enhacing brglm
enhancing(pkg_net, package = "brglm", exact = TRUE)
## Find all packages linking to RcppArmadillo
linking_to(pkg_net, package = "RcppArmadillo", exact = TRUE)
## Find the release date of RcppArmadillo
release_date_of(pkg_net, package = "RcppArmadillo", exact = TRUE)
## Find the release data of all packages with "brglm" in their name
release_date_of(pkg_net, package = "brglm", exact = FALSE)
## More information about packages with "brglm" in their name
release_date_of(pkg_net, package = "brglm", exact = FALSE, flat = FALSE)[c("package", "version")]

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

# }

Run the code above in your browser using DataCamp Workspace