diff --git a/.Rbuildignore b/.Rbuildignore index 01dc57b..995682b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,2 +1,7 @@ ## Ignore travis config file ^\.travis\.yml$ +^.*\.Rproj$ +^\.Rproj\.user$ +^\.github$ +^docs$ +^_pkgdown\.yml$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..0ce1091 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1,3 @@ +*.html +R-version +depends.Rds diff --git a/.github/workflows/roscron-check-standard.yaml b/.github/workflows/roscron-check-standard.yaml new file mode 100644 index 0000000..90f1eb9 --- /dev/null +++ b/.github/workflows/roscron-check-standard.yaml @@ -0,0 +1,89 @@ +# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. +# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions +on: + push: + branches: + - main + - master + pull_request: + branches: + - main + - master + schedule: + - cron: '30 08 1 * *' + + + +name: R-CMD-check + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: windows-latest, r: 'release'} + - {os: macOS-latest, r: 'release'} + - {os: ubuntu-latest, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-latest, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + + env: + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true + RSPM: ${{ matrix.config.rspm }} + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@master + with: + r-version: ${{ matrix.config.r }} + + - uses: r-lib/actions/setup-pandoc@master + + - name: Query dependencies + run: | + install.packages('remotes') + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + shell: Rscript {0} + + - name: Restore R package cache + uses: actions/cache@v2.1.6 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + + - name: Install system dependencies + if: runner.os == 'Linux' + run: | + while read -r cmd + do + eval sudo $cmd + done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') + + - name: Install dependencies + run: | + remotes::install_deps(dependencies = TRUE) + remotes::install_cran("rcmdcheck") + shell: Rscript {0} + + - name: Check + env: + _R_CHECK_CRAN_INCOMING_REMOTE_: false + run: | + options(crayon.enabled = TRUE) + rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") + shell: Rscript {0} + + - name: Upload check results + if: failure() + uses: actions/upload-artifact@main + with: + name: ${{ runner.os }}-r${{ matrix.config.r }}-results + path: check diff --git a/.github/workflows/rostemplate-gh-pages.yaml b/.github/workflows/rostemplate-gh-pages.yaml new file mode 100644 index 0000000..fcf7c31 --- /dev/null +++ b/.github/workflows/rostemplate-gh-pages.yaml @@ -0,0 +1,50 @@ +on: + push: + branches: + - main + - master + +name: rostemplate-gh-pages + +jobs: + rostemplate-gh-pages: + runs-on: macOS-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@master + + - uses: r-lib/actions/setup-pandoc@master + + - name: Query dependencies + run: | + install.packages('remotes') + install.packages('devtools') + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + shell: Rscript {0} + + - name: Cache R packages + uses: actions/cache@v2.1.6 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + + - name: Install dependencies + run: | + remotes::install_deps(dependencies = TRUE) + remotes::install_github("ropenspain/rostemplate", dependencies = TRUE, force = TRUE) + + shell: Rscript {0} + + - name: Install package + run: R CMD INSTALL . + + - name: Deploy package + run: | + git config --local user.email "actions@github.com" + git config --local user.name "GitHub Actions" + Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE, clean = TRUE)' diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f4f606b --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.Rproj.user +.Rhistory +.RData +.Ruserdata +*.Rproj diff --git a/DESCRIPTION b/DESCRIPTION index 9d20fca..d2de870 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,19 +1,40 @@ -Package: MicroDatosEs Type: Package +Package: MicroDatosEs Title: Utilities for Official Spanish Microdata Version: 0.8.12 Date: 2018-05-13 -Encoding: UTF-8 -Authors@R: c( person("Carlos J.", "Gil Bellosta", email="cgb@datanalytics.com", role=c('aut', 'cre')), - person("Carlos", "Neira", email = "cneirac@gmail.com", role="ctb"), - person("Diego", "Paniagua Sánchez", email = "dpansan@gmail.com", role="ctb"), - person("Fiorella", "Mori Peláez", email = "fiorella.mori.pelaez@gmail.com", role="ctb"), - person("Jorge", "López Pérez", email = "jorge@loperez.com", role="ctb"), - person("José Luis", "Cañadas Reche", email = "canadasreche@gmail.com", role="ctb")) -Description: Provides utilities for reading and processing microdata from Spanish official statistics with R. -URL: http://www.datanalytics.com/2012/08/06/un-paseo-por-el-paquete-microdatoses-y-la-epa-de-nuevo/ -Depends: readr +Authors@R: + c(person(given = "Carlos J.", + family = "Gil Bellosta", + role = c("aut", "cre"), + email = "cgb@datanalytics.com"), + person(given = "Carlos", + family = "Neira", + role = "ctb", + email = "cneirac@gmail.com"), + person(given = "Diego", + family = "Paniagua Sánchez", + role = "ctb", + email = "dpansan@gmail.com"), + person(given = "Fiorella", + family = "Mori Peláez", + role = "ctb", + email = "fiorella.mori.pelaez@gmail.com"), + person(given = "Jorge", + family = "López Pérez", + role = "ctb", + email = "jorge@loperez.com"), + person(given = "José Luis", + family = "Cañadas Reche", + role = "ctb", + email = "canadasreche@gmail.com")) +Description: Provides utilities for reading and processing microdata from + Spanish official statistics with R. License: GPL-3 -LazyLoad: yes -LazyData: yes -RoxygenNote: 6.0.1 +URL: https://github.com/ropenspain/MicroDatosEs, + https://www.datanalytics.com/2012/08/06/un-paseo-por-el-paquete-microdatoses-y-la-epa-de-nuevo/ +BugReports: https://github.com/ropenspain/MicroDatosEs/issues +Depends: + readr +Encoding: UTF-8 +RoxygenNote: 7.1.1 diff --git a/R/censo2010.R b/R/censo2010.R index c3d3e1c..a34c10b 100644 --- a/R/censo2010.R +++ b/R/censo2010.R @@ -19,7 +19,7 @@ #' raw <- censo2010("MicrodatosCP_NV_per_nacional_3VAR.txt") #' summary(raw) #' } -#' @seealso \code{\link[read_fwf]{readr}} to read fixed width files. +#' @seealso \code{\link[readr]{read_fwf}} to read fixed width files. ################################################################### diff --git a/R/defun2011.R b/R/defun2011.R index c716ebf..d3d885b 100644 --- a/R/defun2011.R +++ b/R/defun2011.R @@ -18,7 +18,7 @@ #' raw <- defun2011("datos_2016.zip") # It will be automatically uncompressed. #' summary(raw) #' } -#' @seealso \code{\link[read_fwf]{readr}} to read fixed width files. +#' @seealso \code{\link[readr]{read_fwf}} to read fixed width files. ################################################################### diff --git a/R/ees2010.R b/R/ees2010.R index 2bd6d18..46fc295 100644 --- a/R/ees2010.R +++ b/R/ees2010.R @@ -17,7 +17,7 @@ #' raw <- ees2010("datos_2014.zip") # It will be automatically uncompressed. #' summary(raw) #' } -#' @seealso \code{\link[read_fwf]{readr}} to read fixed width files. +#' @seealso \code{\link[readr]{read_fwf}} to read fixed width files. ################################################################### diff --git a/R/epa2005.R b/R/epa2005.R index a936cb2..49a1542 100644 --- a/R/epa2005.R +++ b/R/epa2005.R @@ -17,7 +17,7 @@ #' raw <- epa2005("EPA4T017") #' summary(raw) #' } -#' @seealso \code{\link[read_fwf]{readr}} to read fixed width files. +#' @seealso \code{\link[readr]{read_fwf}} to read fixed width files. ################################################################### diff --git a/R/epf.2011.gastos.R b/R/epf.2011.gastos.R index 75e201b..be69baf 100644 --- a/R/epf.2011.gastos.R +++ b/R/epf.2011.gastos.R @@ -17,7 +17,7 @@ #' raw <- epf.2011.gastos("sample_gastos_a2011.txt") #' summary(raw) #' } -#' @seealso \code{\link[read_fwf]{readr}} to read fixed width files. +#' @seealso \code{\link[readr]{read_fwf}} to read fixed width files. ################################################################### diff --git a/R/epf.2011.hogares.R b/R/epf.2011.hogares.R index 28fc26e..a16aa3a 100644 --- a/R/epf.2011.hogares.R +++ b/R/epf.2011.hogares.R @@ -17,7 +17,7 @@ #' raw <- epf.2011.gastos("sample_hogares_a2011.txt") #' summary(raw) #' } -#' @seealso \code{\link[read_fwf]{readr}} to read fixed width files. +#' @seealso \code{\link[readr]{read_fwf}} to read fixed width files. ################################################################### diff --git a/R/epf.2011.miembros.R b/R/epf.2011.miembros.R index 4a646f6..9517763 100644 --- a/R/epf.2011.miembros.R +++ b/R/epf.2011.miembros.R @@ -17,7 +17,7 @@ #' raw <- epf.2011.gastos("sample_miembros_a2011.txt") #' summary(raw) #' } -#' @seealso \code{\link[read_fwf]{readr}} to read fixed width files. +#' @seealso \code{\link[readr]{read_fwf}} to read fixed width files. diff --git a/R/padron2016.R b/R/padron2016.R index 66b7079..fab8c5d 100644 --- a/R/padron2016.R +++ b/R/padron2016.R @@ -17,7 +17,7 @@ #' raw <- epf.2011.gastos("sample_padron_2016.txt") #' summary(raw) #' } -#' @seealso \code{\link[read_fwf]{readr}} to read fixed width files. +#' @seealso \code{\link[readr]{read_fwf}} to read fixed width files. ################################################################### diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..2bda70c --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,2 @@ +template: + package: rostemplate diff --git a/man/censo2010.Rd b/man/censo2010.Rd index dd621b2..46a046a 100644 --- a/man/censo2010.Rd +++ b/man/censo2010.Rd @@ -27,7 +27,7 @@ The \code{file} parameter allows any flat file with fixed width. } \examples{ -# Downloaded \\href{ftp://www.ine.es/temas/censopv/cen11/Microdatos_personas_nacional.zip}{data} +# Downloaded \href{ftp://www.ine.es/temas/censopv/cen11/Microdatos_personas_nacional.zip}{data} \dontrun{ raw <- censo2010("MicrodatosCP_NV_per_nacional_3VAR.txt") summary(raw) @@ -37,7 +37,7 @@ summary(raw) http://www.ine.es/prodyser/microdatos.htm } \seealso{ -\code{\link[read_fwf]{readr}} to read fixed width files. +\code{\link[readr]{read_fwf}} to read fixed width files. } \author{ Carlos Neira and Carlos J. Gil Bellosta diff --git a/man/defun2011.Rd b/man/defun2011.Rd index 5e5bddb..cc31c7c 100644 --- a/man/defun2011.Rd +++ b/man/defun2011.Rd @@ -35,7 +35,7 @@ summary(raw) http://www.ine.es/prodyser/microdatos.htm } \seealso{ -\code{\link[read_fwf]{readr}} to read fixed width files. +\code{\link[readr]{read_fwf}} to read fixed width files. } \author{ Carlos J. Gil Bellosta diff --git a/man/ees2010.Rd b/man/ees2010.Rd index cd51510..e8a7ad5 100644 --- a/man/ees2010.Rd +++ b/man/ees2010.Rd @@ -34,7 +34,7 @@ summary(raw) http://www.ine.es/prodyser/microdatos.htm } \seealso{ -\code{\link[read_fwf]{readr}} to read fixed width files. +\code{\link[readr]{read_fwf}} to read fixed width files. } \author{ Carlos J. Gil Bellosta, with major contributions from José Luis Cañadas Reche diff --git a/man/epa2005.Rd b/man/epa2005.Rd index 4d5f0b8..10d9b09 100644 --- a/man/epa2005.Rd +++ b/man/epa2005.Rd @@ -33,7 +33,7 @@ summary(raw) http://www.ine.es/prodyser/microdatos.htm } \seealso{ -\code{\link[read_fwf]{readr}} to read fixed width files. +\code{\link[readr]{read_fwf}} to read fixed width files. } \author{ Carlos J. Gil Bellosta diff --git a/man/epf.2011.gastos.Rd b/man/epf.2011.gastos.Rd index ea17286..36eb746 100644 --- a/man/epf.2011.gastos.Rd +++ b/man/epf.2011.gastos.Rd @@ -33,7 +33,7 @@ summary(raw) http://www.ine.es/prodyser/microdatos.htm } \seealso{ -\code{\link[read_fwf]{readr}} to read fixed width files. +\code{\link[readr]{read_fwf}} to read fixed width files. } \author{ Diego Paniagua Sánchez and Carlos J. Gil Bellosta diff --git a/man/epf.2011.hogares.Rd b/man/epf.2011.hogares.Rd index e4b282b..4de6384 100644 --- a/man/epf.2011.hogares.Rd +++ b/man/epf.2011.hogares.Rd @@ -33,7 +33,7 @@ summary(raw) http://www.ine.es/prodyser/microdatos.htm } \seealso{ -\code{\link[read_fwf]{readr}} to read fixed width files. +\code{\link[readr]{read_fwf}} to read fixed width files. } \author{ Diego Paniagua Sánchez and Carlos J. Gil Bellosta diff --git a/man/epf.2011.miembros.Rd b/man/epf.2011.miembros.Rd index 9a1d614..3172ee4 100644 --- a/man/epf.2011.miembros.Rd +++ b/man/epf.2011.miembros.Rd @@ -33,7 +33,7 @@ summary(raw) http://www.ine.es/prodyser/microdatos.htm } \seealso{ -\code{\link[read_fwf]{readr}} to read fixed width files. +\code{\link[readr]{read_fwf}} to read fixed width files. } \author{ Diego Paniagua Sánchez and Carlos J. Gil Bellosta diff --git a/man/padron2016.Rd b/man/padron2016.Rd index 7d6e2c3..f4af1e9 100644 --- a/man/padron2016.Rd +++ b/man/padron2016.Rd @@ -33,7 +33,7 @@ summary(raw) http://www.ine.es/prodyser/microdatos.htm } \seealso{ -\code{\link[read_fwf]{readr}} to read fixed width files. +\code{\link[readr]{read_fwf}} to read fixed width files. } \author{ Carlos J. Gil Bellosta; metadata provided by Fiorella Mori.