diff --git a/CITATION.cff b/CITATION.cff index ace070d..fbe3169 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -25,7 +25,7 @@ preferred-citation: email: diego.hernangomezherrero@gmail.com orcid: https://orcid.org/0000-0001-8457-4658 affiliation: rOpenSpain - year: '2023' + year: '2024' url: https://ropenspain.github.io/rostemplate/ abstract: Plantilla privada para uso exclusivo de los paquetes de rOpenSpain. repository-code: https://github.com/ropenspain/rostemplate @@ -54,7 +54,7 @@ references: - name: R Core Team location: name: Vienna, Austria - year: '2023' + year: '2024' institution: name: R Foundation for Statistical Computing version: '>= 3.6' @@ -75,7 +75,7 @@ references: - family-names: Salmon given-names: Maëlle orcid: https://orcid.org/0000-0002-2815-0399 - year: '2023' + year: '2024' version: '>= 2.0.0' - type: software title: styler @@ -91,7 +91,7 @@ references: - family-names: Walthert given-names: Lorenz email: lorenz.walthert@icloud.com - year: '2023' + year: '2024' - type: software title: usethis abstract: 'usethis: Automate Package and Project Setup' @@ -115,7 +115,7 @@ references: given-names: Andy email: andy.teucher@posit.co orcid: https://orcid.org/0000-0002-7840-692X - year: '2023' + year: '2024' version: '>= 2.0.0' - type: software title: utils @@ -125,7 +125,7 @@ references: - name: R Core Team location: name: Vienna, Austria - year: '2023' + year: '2024' institution: name: R Foundation for Statistical Computing - type: software @@ -139,7 +139,7 @@ references: given-names: Yihui email: xie@yihui.name orcid: https://orcid.org/0000-0003-0645-5666 - year: '2023' + year: '2024' - type: software title: rmarkdown abstract: 'rmarkdown: Dynamic Documents for R' @@ -182,7 +182,7 @@ references: given-names: Richard email: rich@posit.co orcid: https://orcid.org/0000-0003-3925-190X - year: '2023' + year: '2024' - type: software title: scales abstract: 'scales: Scale Functions for Visualization' @@ -192,10 +192,14 @@ references: authors: - family-names: Wickham given-names: Hadley - email: hadley@rstudio.com + email: hadley@posit.co + - family-names: Pedersen + given-names: Thomas Lin + email: thomas.pedersen@posit.co + orcid: https://orcid.org/0000-0002-5147-4711 - family-names: Seidel given-names: Dana - year: '2023' + year: '2024' - type: software title: testthat abstract: 'testthat: Unit Testing for R' @@ -206,5 +210,5 @@ references: - family-names: Wickham given-names: Hadley email: hadley@posit.co - year: '2023' + year: '2024' version: '>= 3.0.0' diff --git a/DESCRIPTION b/DESCRIPTION index faa45e6..ba37b26 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -29,5 +29,5 @@ Config/testthat/edition: 3 Encoding: UTF-8 Language: es_ES Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.0 X-schema.org-isPartOf: https://ropenspain.es/ diff --git a/codemeta.json b/codemeta.json index aa95769..fc4a7a6 100644 --- a/codemeta.json +++ b/codemeta.json @@ -14,7 +14,7 @@ "name": "R", "url": "https://r-project.org" }, - "runtimePlatform": "R version 4.3.1 (2023-06-16)", + "runtimePlatform": "R version 4.3.2 (2023-10-31)", "author": [ { "@type": "Person", @@ -150,7 +150,7 @@ "citation": [ { "@type": "SoftwareSourceCode", - "datePublished": "2023", + "datePublished": "2024", "author": [ { "@type": "Person", diff --git a/inst/schemaorg.json b/inst/schemaorg.json index 1315713..871fd43 100644 --- a/inst/schemaorg.json +++ b/inst/schemaorg.json @@ -22,7 +22,7 @@ "name": "R", "url": "https://r-project.org" }, - "runtimePlatform": "R version 4.3.1 (2023-06-16)", + "runtimePlatform": "R version 4.3.2 (2023-10-31)", "version": "0.1.1.9100" }, { diff --git a/vignettes/articles/descargas.Rmd b/vignettes/articles/descargas.Rmd index f09844e..e33c202 100644 --- a/vignettes/articles/descargas.Rmd +++ b/vignettes/articles/descargas.Rmd @@ -4,7 +4,6 @@ title: "Descargas de paquetes de rOpenSpain" *Fecha de actualización: `r format(Sys.Date(),"%d %b %Y")`* - ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, @@ -19,8 +18,9 @@ knitr::opts_chunk$set( ) ``` -Descargas de paquetes de rOpenSpain desde CRAN. +## En CRAN +Descargas de paquetes de [rOpenSpain](https://ropenspain.es/) desde CRAN. ```{r include=FALSE} library(cranlogs) @@ -31,6 +31,8 @@ library(jsonlite) allrepos <- jsonlite::read_json( "https://api.github.com/orgs/ropenspain/repos?per_page=100" ) + +Sys.setenv("R_CRAN_WEB" = "https://cloud.r-project.org") crandb <- unique(tools::CRAN_package_db()$Package) ropenspain <- unlist(lapply(allrepos, function(x) { x$name @@ -82,8 +84,7 @@ fact <- fechas %>% dwn_m$package <- factor(dwn_m$package, levels = unique(fact)) ``` - -## Total de descargas +### Histórico de descargas ```{r echo=FALSE} ggplot(dwn_m, aes(x = m)) + @@ -101,7 +102,7 @@ ggplot(dwn_m, aes(x = m)) + theme(axis.title = element_text(size = 8)) ``` -## Descargas por semana +### Descargas semanales ```{r echo=FALSE} dwn_w <- dwn %>% @@ -133,8 +134,7 @@ ggplot(dwn_w, aes(x = m)) + ) ``` - -## Datos +### Datos sobre descargas ```{r datos, echo=FALSE} library(reactable) @@ -188,6 +188,69 @@ reactable( showPageSizeOptions = TRUE, striped = TRUE, paginationType = "jump", - elementId = "station-table" + elementId = "cran-dwn" +) +``` + +## En Posit Package Manager + +Descargas de paquetes de [rOpenSpain](https://ropenspain.es/) y metadatos desde +[Posit Package Manager](https://packagemanager.posit.co/client/#/). + +```{r data-posit, echo=FALSE} +res <- lapply(ropenspain, function(x) { + tmp <- tempfile(fileext = ".json") + api_res <- suppressWarnings(try(download.file( + paste0("https://packagemanager.posit.co/__api__/repos/1/packages/", x), + tmp, + quiet = TRUE + ), silent = TRUE)) + + if (inherits(api_res, "try-error")) { + return(NULL) + } + + info <- jsonlite::read_json(tmp) + + df_init <- as_tibble( + info[c("name", "date_publication", "occurred", "package_size", "version")] + ) + + + df_prep <- df_init %>% + mutate( + date_in_cran = as.Date(date_publication), + date_in_ppm = as.Date(occurred), + psize = paste(round(package_size / (1024^2), 2), "Mb"), + mdown = as.integer(info$downloads) + ) %>% + select( + package = name, + lvers = version, + date_in_cran, date_in_ppm, , psize, mdown + ) + + + df_prep +}) + +res_all <- bind_rows(res) %>% + arrange(desc(mdown)) + +names(res_all) <- c( + "paquete", "Última version", "Version en CRAN", + "Version en Posit", "Tamaño", "Descargas (último mes)" +) + + +reactable( + res_all, + filterable = TRUE, + searchable = TRUE, + showPageSizeOptions = TRUE, + striped = TRUE, + paginationType = "jump", + elementId = "posit-dwn", + defaultPageSize = nrow(res_all) ) ```