The practice
package provides some datasets, particularly about CRAN, that make it easier to use. For maximum transparency, it is set up to construct these datasets using its own functions.
library(practice)
For example, the CRANmetadata
object contains a list of lists, each representing metadata information about a CRAN package. It ships with the practice
package.
str(CRANmetadata, max.level = 1, list.len = 6) str(CRANmetadata[[1]], max.level = 2)
You can create or update this data yourself, using the update_CRAN_metadata()
function:
practice:::update_CRAN_metadata(verbose = TRUE)
Note: as you might expect, this will take several minutes! You can always explore the pre-built CRANmetadata
object first and update later at your convenience. If you do update the object, remember to re-install the package via, e.g. devtools::install()
.
The sources of CRAN packages do not come included with the package, since they're ~ 5 GB and counting. However, practice
provides a function to download them yourself:
download_packages(get_package_names(), "cran_sources", quiet = FALSE)
This will download the sources of all packages into the cran_sources
directory.
The CRANpractices
dataset contains information on all CRAN packages and whether they follow software engineering practices. Once the package sources are downloaded as above, it can be created with:
practice:::update_CRAN_practices(src_dir = "cran_sources")
(This takes about two minutes). The data looks like:
library(practice) library(dplyr) CRANpractices
You can use it to answer questions about the frequency of particular practices:
CRANpractices %>% count(license) %>% arrange(desc(n)) CRANpractices %>% count(vignette_format, vignette_builder) %>% ungroup() %>% arrange(desc(n))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.