knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.width = 6, fig.height = 6 )
The current vignette is a quick analysis of all CRAN packages that have "glm" in their name. The crude assumption we make here is that a package with "glm" in its name does something related to generalized linear models.
Let's attach cranly
library("cranly")
and use instances of the package directives and author collaboration networks
package_network <- readRDS(url("https://raw.githubusercontent.com/ikosmidis/cranly/develop/inst/extdata/package_network.rds")) author_network <- readRDS(url("https://raw.githubusercontent.com/ikosmidis/cranly/develop/inst/extdata/author_network.rds"))
from CRAN's state on r format(attr(package_network, "timestamp"), usetz = TRUE)
Alternatively, today's package directives and author collaboration networks can be constructed by doing
cran_db <- clean_CRAN_db() package_network <- build_network(cran_db) author_network <- build_network(cran_db, perspective = "author")
The packages that have "glm" in their name are
(glm_packages <- package_with(package_network, name = "glm"))
The sub-network for glm_packages
can be visualized using
plot(package_network, package = glm_packages)
In order to focus on the sub-network with edges only between the packages in glm_packages
, we do
glm_package_only_network <- subset(package_network, package = glm_packages, only = TRUE) plot(glm_package_only_network, package = glm_packages)
The top-20 packages in terms of various statistics of the directives sub-network for generalized linear models according to the number they are imported by other packages
glm_package_network <- subset(package_network, package = glm_packages) glm_package_summaries <- summary(glm_package_network) plot(glm_package_summaries, according_to = "n_imported_by")
The top-20 in the collaboration sub-network for generalized linear models according to the number of collaborators is
glm_author_network <- subset(author_network, package = glm_packages) glm_author_summaries <- summary(glm_author_network) plot(glm_author_summaries, according_to = "n_collaborators")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.