Skip to content

Commit

Permalink
Update docs and vignettes
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Jan 16, 2024
1 parent a8a38e5 commit f9f7076
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 23 deletions.
26 changes: 15 additions & 11 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ preferred-citation:
email: [email protected]
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
Expand Down Expand Up @@ -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'
Expand All @@ -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
Expand All @@ -91,7 +91,7 @@ references:
- family-names: Walthert
given-names: Lorenz
email: [email protected]
year: '2023'
year: '2024'
- type: software
title: usethis
abstract: 'usethis: Automate Package and Project Setup'
Expand All @@ -115,7 +115,7 @@ references:
given-names: Andy
email: [email protected]
orcid: https://orcid.org/0000-0002-7840-692X
year: '2023'
year: '2024'
version: '>= 2.0.0'
- type: software
title: utils
Expand All @@ -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
Expand All @@ -139,7 +139,7 @@ references:
given-names: Yihui
email: [email protected]
orcid: https://orcid.org/0000-0003-0645-5666
year: '2023'
year: '2024'
- type: software
title: rmarkdown
abstract: 'rmarkdown: Dynamic Documents for R'
Expand Down Expand Up @@ -182,7 +182,7 @@ references:
given-names: Richard
email: [email protected]
orcid: https://orcid.org/0000-0003-3925-190X
year: '2023'
year: '2024'
- type: software
title: scales
abstract: 'scales: Scale Functions for Visualization'
Expand All @@ -192,10 +192,14 @@ references:
authors:
- family-names: Wickham
given-names: Hadley
email: [email protected]
email: [email protected]
- family-names: Pedersen
given-names: Thomas Lin
email: [email protected]
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'
Expand All @@ -206,5 +210,5 @@ references:
- family-names: Wickham
given-names: Hadley
email: [email protected]
year: '2023'
year: '2024'
version: '>= 3.0.0'
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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/
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.1 (2023-06-16)",
"runtimePlatform": "R version 4.3.2 (2023-10-31)",
"author": [
{
"@type": "Person",
Expand Down Expand Up @@ -150,7 +150,7 @@
"citation": [
{
"@type": "SoftwareSourceCode",
"datePublished": "2023",
"datePublished": "2024",
"author": [
{
"@type": "Person",
Expand Down
2 changes: 1 addition & 1 deletion inst/schemaorg.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand Down
79 changes: 71 additions & 8 deletions vignettes/articles/descargas.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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)) +
Expand All @@ -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 %>%
Expand Down Expand Up @@ -133,8 +134,7 @@ ggplot(dwn_w, aes(x = m)) +
)
```


## Datos
### Datos sobre descargas

```{r datos, echo=FALSE}
library(reactable)
Expand Down Expand Up @@ -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)
)
```

0 comments on commit f9f7076

Please sign in to comment.