diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index ed7650c..97eaed4 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -32,7 +32,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::pkgdown, local::. + extra-packages: any::pkgdown, local::., ropenspain/rostemplate needs: website - name: Build site diff --git a/DESCRIPTION b/DESCRIPTION index 37b3086..9163dae 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,7 +4,7 @@ Title: Download Data From 2021 Spanish Census Version: 0.1.0 Author: Héctor Meleiro Maintainer: Héctor Meleiro -Description: Retrieves data from the 2021 Spanish census through the National Institute of Statistics official API. For more info on the available tables and variables visit https://www.ine.es/dyngs/DataLab/en/manual.html?cid=1259945952385. +Description: Retrieves data from the 2021 Spanish census through the National Institute of Statistics official API. For more info on the available tables and variables visit . License: GPL (>= 3) Encoding: UTF-8 LazyData: true @@ -23,4 +23,6 @@ Suggests: tidygraph, scales VignetteBuilder: knitr -URL: https://hmeleiro.github.io/tidycenso/ +URL: https://ropenspain.github.io/tidycenso/, https://github.com/rOpenSpain/tidycenso +BugReports: https://github.com/ropenspain/tidycenso/issues +Roxygen: list(markdown = TRUE) diff --git a/R/get_censo.R b/R/get_censo.R index b09e48c..3587c0a 100644 --- a/R/get_censo.R +++ b/R/get_censo.R @@ -1,6 +1,6 @@ #' Get data from the 2021 Spanish census #' -#' `get_censo` retrieves data from the 2021 Spanish census through the API of the National Institute of Statistics. For more info on the available tables and variables visit https://www.ine.es/dyngs/DataLab/en/manual.html?cid=1259945952385. +#' `get_censo` retrieves data from the 2021 Spanish census through the API of the National Institute of Statistics. For more info on the available tables and variables visit . #' #' @param table A string of length 1 with the table name to query data from. #' @param variables A string with variable names of the queried table. If more than one, must be provided using c() (max. 4) diff --git a/R/tidycenso-package.R b/R/tidycenso-package.R new file mode 100644 index 0000000..a65cf64 --- /dev/null +++ b/R/tidycenso-package.R @@ -0,0 +1,6 @@ +#' @keywords internal +"_PACKAGE" + +## usethis namespace: start +## usethis namespace: end +NULL diff --git a/README.Rmd b/README.Rmd index 41af594..57fff13 100644 --- a/README.Rmd +++ b/README.Rmd @@ -17,8 +17,8 @@ knitr::opts_chunk$set( -[![R-CMD-check](https://github.com/hmeleiro/tidycenso/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/hmeleiro/tidycenso/actions/workflows/R-CMD-check.yaml) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) - +[![R-CMD-check](https://github.com/rOpenSpain/tidycenso/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rOpenSpain/tidycenso/actions/workflows/R-CMD-check.yaml) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) +[![rOS-badge](https://ropenspain.github.io/rostemplate/reference/figures/ropenspain-badge.svg)](https://ropenspain.es/) ## Overview diff --git a/README.md b/README.md index f3f6159..86716a6 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,10 @@ -[![R-CMD-check](https://github.com/hmeleiro/tidycenso/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/hmeleiro/tidycenso/actions/workflows/R-CMD-check.yaml) +[![R-CMD-check](https://github.com/rOpenSpain/tidycenso/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rOpenSpain/tidycenso/actions/workflows/R-CMD-check.yaml) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) - +[![rOS-badge](https://ropenspain.github.io/rostemplate/reference/figures/ropenspain-badge.svg)](https://ropenspain.es/) ## Overview @@ -44,9 +44,9 @@ head(df) #> 1 25464 Andalucía Hasta 30 m2 #> 2 2586 Aragón Hasta 30 m2 #> 3 3255 Asturias, Principado de Hasta 30 m2 -#> 4 7683 Balears, Illes Hasta 30 m2 +#> 4 7686 Balears, Illes Hasta 30 m2 #> 5 11766 Canarias Hasta 30 m2 -#> 6 1008 Cantabria Hasta 30 m2 +#> 6 1005 Cantabria Hasta 30 m2 tidycenso::tables #> id_tabla descripcion_tabla_es diff --git a/_pkgdown.yml b/_pkgdown.yml index 29fedf4..60a1acf 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,4 +1,32 @@ -url: https://hmeleiro.github.io/tidycenso/ +url: https://ropenspain.github.io/tidycenso/ template: - bootstrap: 5 + package: rostemplate +lang: en +navbar: + structure: + left: [intro, reference, articles] + right: [github, twitter, search] + components: + github: + icon: fa-github + href: https://github.com/rOpenSpain/tidycenso + aria-label: Github + twitter: + icon: fa-twitter + href: http://twitter.com/hmeleiros + aria-label: Twitter +repo: + url: + home: https://github.com/rOpenSpain/tidycenso + issue: https://github.com/rOpenSpain/tidycenso/issues/ + user: https://github.com/hmeleiro/ +home: + links: + - text: Report a bug + href: https://github.com/rOpenSpain/infoelectoral/issues + sidebar: + structure: [links, license, authors, citation, dev] +authors: + Héctor Meleiro: + href: 'https://hmeleiro.com/' diff --git a/man/get_censo.Rd b/man/get_censo.Rd index 704b0d6..ecbc605 100644 --- a/man/get_censo.Rd +++ b/man/get_censo.Rd @@ -11,7 +11,7 @@ get_censo(table, variables, metrics, language = "ES") \item{variables}{A string with variable names of the queried table. If more than one, must be provided using c() (max. 4)} -\item{metrics}{A string with the units of measurement of the queried data. If more than one, must be provided concatenated using `c()`} +\item{metrics}{A string with the units of measurement of the queried data. If more than one, must be provided concatenated using \code{c()}} \item{language}{The language used in the body request (the only valid values are 'EN' or 'ES')} } @@ -19,7 +19,7 @@ get_censo(table, variables, metrics, language = "ES") A data.frame with the queried data } \description{ -`get_censo` retrieves data from the 2021 Spanish census through the API of the National Institute of Statistics. For more info on the available tables and variables visit https://www.ine.es/dyngs/DataLab/en/manual.html?cid=1259945952385. +\code{get_censo} retrieves data from the 2021 Spanish census through the API of the National Institute of Statistics. For more info on the available tables and variables visit \url{https://www.ine.es/dyngs/DataLab/en/manual.html?cid=1259945952385}. } \examples{ df <- get_censo("hog", c("ID_SUP_VIV", "ID_RESIDENCIA_N1"), "SHOGARES") diff --git a/man/metrics.Rd b/man/metrics.Rd index 55b1381..3c2bb53 100644 --- a/man/metrics.Rd +++ b/man/metrics.Rd @@ -7,13 +7,13 @@ \format{ A data frame with 51 rows and 4 columns: \describe{ - \item{id_tabla}{Table ID} - \item{id_unidad_de_medida}{unit ID} - \item{descripcion_unidad_de_medida_es, descripcion_unidad_de_medida_en}{Content description of the unit of measurement in spanish and english} +\item{id_tabla}{Table ID} +\item{id_unidad_de_medida}{unit ID} +\item{descripcion_unidad_de_medida_es, descripcion_unidad_de_medida_en}{Content description of the unit of measurement in spanish and english} } } \source{ - +\url{https://www.ine.es/censos2021/SDC21_variables_disponibles.xlsx} } \usage{ metrics diff --git a/man/tables.Rd b/man/tables.Rd index 5c8ad7d..a640c8c 100644 --- a/man/tables.Rd +++ b/man/tables.Rd @@ -7,12 +7,12 @@ \format{ A data frame with 7 rows and 3 columns: \describe{ - \item{id_tabla}{Table ID} - \item{descripcion_tabla_es, descripcion_tabla_en}{Content description of the table in spanish and english} +\item{id_tabla}{Table ID} +\item{descripcion_tabla_es, descripcion_tabla_en}{Content description of the table in spanish and english} } } \source{ - +\url{https://www.ine.es/censos2021/SDC21_tablas_disponibles.xlsx} } \usage{ tables diff --git a/man/tidycenso-package.Rd b/man/tidycenso-package.Rd new file mode 100644 index 0000000..371ba39 --- /dev/null +++ b/man/tidycenso-package.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/tidycenso-package.R +\docType{package} +\name{tidycenso-package} +\alias{tidycenso} +\alias{tidycenso-package} +\title{tidycenso: Download Data From 2021 Spanish Census} +\description{ +Retrieves data from the 2021 Spanish census through the National Institute of Statistics official API. For more info on the available tables and variables visit \url{https://www.ine.es/dyngs/DataLab/en/manual.html?cid=1259945952385}. +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://ropenspain.github.io/tidycenso/} + \item \url{https://github.com/rOpenSpain/tidycenso} + \item Report bugs at \url{https://github.com/ropenspain/tidycenso/issues} +} + +} +\keyword{internal} diff --git a/man/variables.Rd b/man/variables.Rd index b3a2231..e00dfc8 100644 --- a/man/variables.Rd +++ b/man/variables.Rd @@ -7,13 +7,13 @@ \format{ A data frame with 395 rows and 4 columns: \describe{ - \item{id_tabla}{Table ID} - \item{id_variable}{Variable ID} - \item{descripcion_variable_es, descripcion_variable_en}{Content description of the variable in spanish and english} +\item{id_tabla}{Table ID} +\item{id_variable}{Variable ID} +\item{descripcion_variable_es, descripcion_variable_en}{Content description of the variable in spanish and english} } } \source{ - +\url{https://www.ine.es/censos2021/SDC21_variables_disponibles.xlsx} } \usage{ variables diff --git a/vignettes/example-usage.Rmd b/vignettes/example-usage.Rmd index 37b7f75..538fdeb 100644 --- a/vignettes/example-usage.Rmd +++ b/vignettes/example-usage.Rmd @@ -2,7 +2,7 @@ title: "Use case: migration flows" output: rmarkdown::html_vignette vignette: > - %\VignetteIndexEntry{Example} + %\VignetteIndexEntry{Use case: migration flows} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- @@ -14,7 +14,7 @@ knitr::opts_chunk$set( ) ``` -In this use case we show how to use [`tidycensus`](https://github.com/hmeleiro/tidycenso) to visualize the most important internal migration flows over the last 10 years. +In this use case we show how to use [`tidycenso`](https://github.com/rOpenSpain/tidycenso) to visualize the most important internal migration flows over the last 10 years. First download the number of people by province of residence in 2011 and 2020.