Skip to content

Commit

Permalink
Vignettes made more robust against missing dependencies or internet r…
Browse files Browse the repository at this point in the history
…esources

resubmitting
  • Loading branch information
Markus Kainu committed Dec 11, 2023
1 parent df5231c commit 2b52aca
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Imports:
dplyr,
httpcache,
httr,
geofacet,
methods,
purrr,
rlang,
Expand All @@ -38,6 +37,7 @@ Suggests:
covr,
ggplot2,
ggrepel,
geofacet,
htmltools,
httptest (>= 4.0.0),
janitor,
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# geofi 1.0.11

+ Vignettes made more robust agains missing suggested dependencies

# geofi 1.0.10

+ convert_municipality_key_codes-function fixed, thanks @pitkant
Expand Down
3 changes: 1 addition & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
## Test environments
* local ubuntu 22.04 install, R 4.3.1
* local ubuntu 22.04 install, R 4.3.2
* win-builder (devel)
* r-hub.io

## Submission note

* Vignettes made more robust against missing dependencies or internet resources
* More verbose description field that better describes what the package does and why it may be useful

## R CMD check results

Expand Down
12 changes: 6 additions & 6 deletions vignettes/geofi_datasets.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Spatial data is provided as administrative regions (polygons), population and st

Municipality borders are provided yearly from 2013 and in two scales 1: 1 000 000 and 1:4 500 000. Use `1000` or `4500` as value for `scale`-argument, respectively.

```{r municipality_map, fig.height = 7, fig.width = 4, eval = apiacc}
```{r municipality_map, fig.height = 7, fig.width = 4, eval = apiacc_pkginst}
municipalities <- get_municipalities(year = 2023, scale = 4500)
plot(municipalities["municipality_name_fi"], border = NA)
```
Expand Down Expand Up @@ -136,7 +136,7 @@ get_municipality_pop(year = 2022) %>%

Zipcodes are provided in a single resolution from 2015.

```{r zipcode_map, fig.height = 7, fig.width = 4, eval = apiacc}
```{r zipcode_map, fig.height = 7, fig.width = 4, eval = apiacc_pkginst}
zipcodes <- get_zipcodes(year = 2023)
plot(zipcodes["nimi"], border = NA)
```
Expand All @@ -147,7 +147,7 @@ plot(zipcodes["nimi"], border = NA)

Statistics Finland [proprietary grid database](https://www.stat.fi/tup/ruututietokanta/index_en.html) provides the attribute statistical data for these grid nets.

```{r statisticsl_grid_data, fig.height = 7, fig.width = 4, eval = apiacc}
```{r statisticsl_grid_data, fig.height = 7, fig.width = 4, eval = apiacc_pkginst}
stat_grid <- get_statistical_grid(resolution = 5, auxiliary_data = TRUE)
plot(stat_grid["euref_x"], border = NA)
```
Expand All @@ -160,7 +160,7 @@ Total population (`vaesto`), number of men (`miehet`) and women (`naiset`), unde

The data describes the population distribution independent of administrative areas (such as municipal borders). The data is suitable for examination of population distribution and making various spatial analysis.

```{r population_grid_data, fig.height = 7, fig.width = 4, eval = apiacc}
```{r population_grid_data, fig.height = 7, fig.width = 4, eval = apiacc_pkginst}
pop_grid <- get_population_grid(year = 2018, resolution = 5)
plot(pop_grid["kunta"], border = NA)
```
Expand All @@ -169,7 +169,7 @@ plot(pop_grid["kunta"], border = NA)

[National Land Survey of Finland](https://maanmittauslaitos.fi) maintains [Topological Database](https://www.maanmittauslaitos.fi/en/maps-and-spatial-data/datasets-and-interfaces/product-descriptions/topographic-database) that contains a wide range of layers from which you can access the locations of central localities of each municipality in Finland.

```{r central_localities, fig.height = 7, fig.width = 4, eval = TRUE}
```{r central_localities, fig.height = 7, fig.width = 4, eval = apiacc_pkginst}
plot(municipality_central_localities["teksti"])
```

Expand All @@ -181,7 +181,7 @@ From Ryan Hafen's [blog](https://ryanhafen.com/blog/geofacet/):
`geofi`-package contains custom grids to be used with various Finnish administrative breakdowns as listed below.

```{r geofacets, eval = TRUE}
```{r geofacets, eval = apiacc_pkginst}
d <- data(package = "geofi")
as_tibble(d$results) %>%
select(Item,Title) %>%
Expand Down

0 comments on commit 2b52aca

Please sign in to comment.