Skip to content

Commit

Permalink
Redo vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Jan 23, 2024
1 parent b7bf7f4 commit d2dcbda
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 59 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@
^CODE_OF_CONDUCT\.md$
^CONTRIBUTING\.md$
^Rplots\.pdf$
^dev$
^/dev$
34 changes: 0 additions & 34 deletions .github/workflows/pkgdown-gh-pages-clean.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/roscron-check-standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- main
- master
schedule:
- cron: '30 10 3 * *'
- cron: '30 12 * * 3'

name: R-CMD-check

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rostemplate-gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE, run_dont_run = TRUE)'
Rscript -e 'pkgdown::deploy_to_branch(new_process = TRUE, run_dont_run = TRUE, clean = TRUE)'
4 changes: 3 additions & 1 deletion .github/workflows/update-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ jobs:
- name: Update docs
run: |
pkgdev::update_docs()
pkgdev::precompute_vignette_all()
pkgdev::update_docs(precompute = FALSE)
shell: Rscript {0}

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/wipe-cache.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Clear all Github actions caches manually
on:
workflow_dispatch:

schedule:
- cron: '30 10 3 * *'
jobs:
cache-clear:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ docs/
cran-comments.md
.Rdata
Rplots.pdf
dev
/dev
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.2 (2023-10-31 ucrt)",
"runtimePlatform": "R version 4.3.2 (2023-10-31)",
"author": [
{
"@type": "Person",
Expand Down Expand Up @@ -190,7 +190,7 @@
},
"SystemRequirements": null
},
"fileSize": "355.237KB",
"fileSize": "350.019KB",
"citation": [
{
"@type": "SoftwareSourceCode",
Expand Down
2 changes: 1 addition & 1 deletion inst/schemaorg.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.3.2 (2023-10-31 ucrt)",
"runtimePlatform": "R version 4.3.2 (2023-10-31)",
"version": "0.0.2.9000"
},
{
Expand Down
Binary file modified man/figures/README-wfs-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 15 additions & 14 deletions vignettes/CatastRoNav.Rmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Get started"
output: rmarkdown::html_vignette
date: "2024-01-22"
date: "2024-01-23"
vignette: >
%\VignetteIndexEntry{Get started}
%\VignetteEngine{knitr::rmarkdown}
Expand All @@ -13,9 +13,8 @@ vignette: >
<!-- CatastRoNav.Rmd is generated from CatastRoNav.Rmd.orig. Please edit that file -->

**CatastRoNav** is a package that provide access to different INSPIRE API
services of the [Cadastre of
Navarre](https://geoportal.navarra.es/es/idena). With
**CatastRoNav** it is possible to download spatial objects as buildings or
services of the [Cadastre of Navarre](https://geoportal.navarra.es/es/idena).
With **CatastRoNav** it is possible to download spatial objects as buildings or
cadastral parcels.

## INSPIRE Services
Expand Down Expand Up @@ -107,33 +106,32 @@ we created before:
# Cut buildings

dataviz <- st_intersection(pamp_bu, pamp_buff)
#> Error in UseMethod("st_intersection"): no applicable method for 'st_intersection' applied to an object of class "NULL"

ggplot(dataviz) +
geom_sf()
#> Error in eval(expr, envir, enclos): object 'dataviz' not found
```

<div class="figure">
<img src="./minimal-1.png" alt="Minimal map" width="100%" />
<p class="caption">Minimal map</p>
</div>

Let's extract now the construction year, available in the column `beginning`:


```r
# Extract 4 initial positions
year <- substr(dataviz$beginning, 1, 4)
#> Error in eval(expr, envir, enclos): object 'dataviz' not found

# Replace all that doesn't look as a number with 0000
year[!(year %in% 0:2500)] <- "0000"
#> Error: object 'year' not found

# To numeric
year <- as.integer(year)
#> Error in eval(expr, envir, enclos): object 'year' not found

# New column
dataviz <- dataviz %>%
mutate(year = year)
#> Error in eval(expr, envir, enclos): object 'dataviz' not found
```

Last step is to create groups based on the year and create the data
Expand All @@ -146,7 +144,6 @@ dataviz <- dataviz %>%
mutate(year_cat = ggplot2::cut_width(year,
width = 10
))
#> Error in eval(expr, envir, enclos): object 'dataviz' not found


# Adjust the color palette
Expand All @@ -155,7 +152,6 @@ dataviz_pal <- hcl.colors(
length(levels(dataviz$year_cat)),
"Spectral"
)
#> Error in eval(expr, envir, enclos): object 'dataviz' not found

ggplot(dataviz) +
geom_sf(aes(fill = year_cat), color = NA) +
Expand All @@ -181,9 +177,14 @@ ggplot(dataviz) +
),
plot.margin = margin(r = 40, l = 40)
)
#> Error in eval(expr, envir, enclos): object 'dataviz' not found
```

<div class="figure">
<img src="./dataviz-1.png" alt="Pamplona: Urban Growth" width="100%" />
<p class="caption">Pamplona: Urban Growth</p>
</div>

## References

- Royé D (2019). "Visualize urban growth." <https://dominicroye.github.io/en/2019/visualize-urban-growth/>.
- Royé D (2019). "Visualize urban growth."
<https://dominicroye.github.io/en/2019/visualize-urban-growth/>.
8 changes: 4 additions & 4 deletions vignettes/CatastRoNav.Rmd.orig
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ knitr::opts_chunk$set(
<!-- CatastRoNav.Rmd is generated from CatastRoNav.Rmd.orig. Please edit that file -->

**CatastRoNav** is a package that provide access to different INSPIRE API
services of the [Cadastre of
Navarre](https://geoportal.navarra.es/es/idena). With
**CatastRoNav** it is possible to download spatial objects as buildings or
services of the [Cadastre of Navarre](https://geoportal.navarra.es/es/idena).
With **CatastRoNav** it is possible to download spatial objects as buildings or
cadastral parcels.

## INSPIRE Services
Expand Down Expand Up @@ -186,4 +185,5 @@ ggplot(dataviz) +

## References

- Royé D (2019). "Visualize urban growth." <https://dominicroye.github.io/en/2019/visualize-urban-growth/>.
- Royé D (2019). "Visualize urban growth."
<https://dominicroye.github.io/en/2019/visualize-urban-growth/>.
Binary file modified vignettes/dataviz-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/minimal-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/olite-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d2dcbda

Please sign in to comment.