#' Reduce `data.frame` of full CRAN archive data to current packages only.
#'
#' @inheritParams pkgstats_from_archive
#' @family archive
#' @export
pkgstats_cran_current_from_full <- function (prev_results, results_file = NULL) {
prev_tarball <- paste0 (prev_results$package, "_", prev_results$version)
cran_pkgs <- get_cran_db ()
cran_tarball <- paste0 (cran_pkgs$Package, "_", cran_pkgs$Version)
index <- which (prev_tarball %in% cran_tarball)
res <- prev_results [index, ]
if (!is.null (res) && !is.null (results_file)) {
results_file <- archive_results_file_name (results_file)
saveRDS (res, results_file)
}
return (res)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.