-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from ropensci-review-tools/cran-current
cran-current-from-archive for #56
- Loading branch information
Showing
9 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: pkgstats | ||
Title: Metrics of R Packages | ||
Version: 0.1.5.027 | ||
Version: 0.1.5.028 | ||
Authors@R: | ||
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"), | ||
comment = c(ORCID = "0000-0003-2172-5265")) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#' 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 <- tools::CRAN_package_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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.