Skip to content

Commit

Permalink
Make vignette non-failable
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksanderbl29 committed Dec 24, 2024
1 parent 720e847 commit e9d9e46
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions vignettes/dawaR.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ library(dplyr)

The function `get_data()` fetches the data in `json` format and by default transforms it to a data.frame.

```{r nordjylland}
```{r nordjylland, eval=FALSE}
library(dawaR)
library(dplyr)
Expand All @@ -48,17 +48,21 @@ municipalities <- get_data("kommuner")
nordjylland <- municipalities |>
filter(regionsnavn == "Region Nordjylland") |>
pull(navn)
```

``` r
nordjylland
#> [1] "Morsø" "Thisted" "Brønderslev" "Frederikshavn"
#> [5] "Vesthimmerlands" "Læsø" "Rebild" "Mariagerfjord"
#> [9] "Jammerbugt" "Aalborg" "Hjørring"
```

Here we have extracted all the municipalities that are in "Region Nordjylland". The same can be done for voting precincts or police regions. It can also be done for addresses and others. Look through the available sections with `available_sections()`.

### Using DAWA map data

The function `get_map_data()` fetches data in `geojson` format and transforms the geometries to `{sf}` polygons. These polygons can be drawn as nice maps with `{ggplot2}`.

```{r municipality_map, output=FALSE}
```{r municipality_map, output=FALSE, eval=FALSE}
library(dawaR)
library(ggplot2)
Expand Down

0 comments on commit e9d9e46

Please sign in to comment.