Skip to content

Commit

Permalink
Update vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Nov 29, 2023
1 parent 4fbca02 commit 21d67d4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 21 deletions.
4 changes: 2 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.3.2 (2023-10-31 ucrt)",
"runtimePlatform": "R version 4.3.2 (2023-10-31)",
"author": [
{
"@type": "Person",
Expand Down Expand Up @@ -259,7 +259,7 @@
},
"isPartOf": "http://ropengov.org/",
"keywords": ["ropengov", "template", "r", "r-package", "github-actions", "pkgdown", "pkgdown-template"],
"fileSize": "656.469KB",
"fileSize": "696.011KB",
"releaseNotes": "https://github.com/rOpenGov/rogtemplate/blob/master/NEWS.md",
"readme": "https://github.com/rOpenGov/rogtemplate/blob/main/README.md",
"contIntegration": "https://github.com/rOpenGov/rogtemplate/actions",
Expand Down
2 changes: 1 addition & 1 deletion inst/schemaorg.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.3.2 (2023-10-31 ucrt)",
"runtimePlatform": "R version 4.3.2 (2023-10-31)",
"version": "0.0.2.9100"
}
31 changes: 13 additions & 18 deletions vignettes/articles/downloads.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ knitr::opts_chunk$set(
dpi = 300,
out.width = "100%"
)
Sys.setenv("R_CRAN_WEB" = "https://cloud.r-project.org")
```

Downloads of rOpenGov packages from CRAN.
Expand All @@ -32,9 +31,7 @@ library(jsonlite)
allrepos <- jsonlite::read_json(
"https://api.github.com/orgs/ropengov/repos?per_page=100"
)
crandb <- unique(tools::CRAN_package_db()$Package)
ropengov <- unlist(lapply(allrepos, function(x) {
x$name
}))
Expand All @@ -47,8 +44,17 @@ dwn <- dwn %>%
tidyr::drop_na() %>%
filter(count > 0)
# By month
library(lubridate)
dwn_m <- dwn %>%
mutate(m = lubridate::ceiling_date(dwn$date, "month") - 1) %>%
group_by(package, m) %>%
summarise(downloads = sum(count))
# Primera fecha en CRAN
# First date on CRAN
first_date_on_cran <- function(pkg) {
url <- paste0(
Expand All @@ -65,22 +71,11 @@ first_date_on_cran <- function(pkg) {
}
fechas <- lapply(unique(dwn$package), first_date_on_cran) %>%
bind_rows() %>%
arrange(date)
# By month
library(lubridate)
dwn_m <- dwn %>%
mutate(m = lubridate::ceiling_date(dwn$date, "month") - 1) %>%
group_by(package, m) %>%
summarise(downloads = sum(count))
bind_rows()
# factores por orden de inclusión en CRAN
# factors by first date on CRAN
fact <- fechas %>%
arrange(date) %>%
pull(package) %>%
unique() %>%
rev()
Expand Down
Binary file modified vignettes/plot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 21d67d4

Please sign in to comment.