Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rostemplate project #9

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ Images
.gitignore
RData
Siane.Rproj

^\.github$
^docs$
^_pkgdown\.yml$
3 changes: 3 additions & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.html
R-version
depends.Rds
89 changes: 89 additions & 0 deletions .github/workflows/roscron-check-standard.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
50 changes: 50 additions & 0 deletions .github/workflows/rostemplate-gh-pages.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 "[email protected]"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE, clean = TRUE)'
44 changes: 29 additions & 15 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
Package: Siane
Title: Explore the Spanish INE Data using this Geographic Tool
Version: 0.1
Description: A tool that assists the user in two tasks: the map reading process and the
data representation process. The reading process is leveraged with functions that allow
the user to find maps in the Siane repository easily, i.e. searching by map year or
administrative level. The other main functionality is to bind numerical data to polygons.
This package is only compatible with the spanish IGN(National Institute of Geography) maps
and the INE(National Institute of Statistics) data.
Imports: plyr, raster, rgdal, sp, methods, utils
Authors@R:
c(person(given = "Carlos J. Gil Bellosta",
role = "aut",
email = "[email protected]"),
person(given = "Nuno",
family = "Carvalho",
role = c("cre", "aut"),
email = "[email protected]"))
Description: A tool that assists the user in two tasks: the map reading
process and the data representation process. The reading process is
leveraged with functions that allow the user to find maps in the Siane
repository easily, i.e. searching by map year or administrative level.
The other main functionality is to bind numerical data to polygons.
This package is only compatible with the spanish IGN(National
Institute of Geography) maps and the INE(National Institute of
Statistics) data.
License: MIT + file LICENSE
Imports:
methods,
plyr,
raster,
rgdal,
sp,
utils
Suggests:
knitr,
rmarkdown
VignetteBuilder:
knitr
Encoding: UTF-8
LazyData: true
Authors@R: c(person("Carlos J. Gil Bellosta",
email = "[email protected]", role = c("aut")),
person("Nuno", "Carvalho", role = c("cre", "aut"),
email = "[email protected]"))
RoxygenNote: 6.0.1
Suggests: knitr,
rmarkdown
VignetteBuilder: knitr
RoxygenNote: 7.1.1
2 changes: 1 addition & 1 deletion R/siane_map.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#' The default value for the year is the latest year in which the maps are available. \cr
#' - The \code{scale} of the maps can be 1:3000000 or 1:6500000. The corresponding values for the \code{scale} variable are "3m" and "6m". \cr
#' The default value for the municipalities maps is \code{scale <- "3m"} . The default value for the other maps is \code{scale <- "6m"} \cr
#' #' - The \code{peninsula} variable can take the values "far", "close" and "none".
#' - The \code{peninsula} variable can take the values "far", "close" and "none".
#' @export
#'
#'
Expand Down
8 changes: 8 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
template:
package: rostemplate

authors:
Carlos J. Gil Bellosta:
href: https://www.datanalytics.com/
Nuno Carvalho:
href: https://github.com/Nuniemsis
8 changes: 4 additions & 4 deletions man/siane_map.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions vignettes/Siane.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ author: "Nuno Carvalho dos Santos"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Vignette Title}
%\VignetteIndexEntry{Siane}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---


## Introduction

[Siane](https://github.com/Nuniemsis/Siane/) (El Sistema de Información del Atlas Nacional de España) is a project that supports technologically the publications and productions of the National Spanish Atlas(ANE). Recently, this project released CARTOSIANE, a set of maps compatible with the National Institute of Statistics georreferenced data(INE).
[Siane](https://github.com/ropenspain/Siane/) (El Sistema de Información del Atlas Nacional de España) is a project that supports technologically the publications and productions of the National Spanish Atlas(ANE). Recently, this project released CARTOSIANE, a set of maps compatible with the National Institute of Statistics georreferenced data(INE).
The aim of this package is to create useful functions that plot INE's georreferenced data on Siane map's polygons.

Siane collects maps from five different scales(1:3M, 1:6.5M, 1:10M, 1:14M, 1:60M). The scope of this project covers the first two scales, i.e, 1:3M and 1:6.5M. The remaining scales represent the countries globally. We are not using those scales. This project focuses only in spanish maps.

Each set of maps is downloaded individually. [The README.md](https://github.com/Nuniemsis/Siane/) file has very detailed information about the downloading process.
Each set of maps is downloaded individually. [The README.md](https://github.com/ropenspain/Siane/) file has very detailed information about the downloading process.

```
SIANE_CARTO_BASE_E_14M.ZIP
Expand All @@ -33,7 +33,7 @@ In this document I will describe and make use of the main functions of this pack

```{r, warning = FALSE, message = FALSE , eval = FALSE}
#library(devtools)
#install_github("Nuniemsis/Siane")
#install_github("ropenspain/Siane")
library(Siane)
library(pxR)
library(RColorBrewer)
Expand Down