-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
95 lines (73 loc) · 2.61 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# geodk
<!-- badges: start -->
[![geodk status badge](https://ropengov.r-universe.dev/badges/geodk)](https://ropengov.r-universe.dev/geodk)
[![R-CMD-check](https://github.com/rOpenGov/geodk/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rOpenGov/geodk/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/ropengov/geodk/graph/badge.svg)](https://app.codecov.io/gh/ropengov/geodk)
[![Project Status: WIP – Development in progress](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
[![rOG-badge](https://ropengov.github.io/rogtemplate/reference/figures/ropengov-badge.svg)](https://ropengov.org/)
<!-- badges: end -->
`{geodk}` provides access to Danish geospatial data.
## Installation
```{r check_cran, include=FALSE}
if (!require(available)) install.packages("available")
is_on_cran <- !available::available_on_cran("geodk")
```
```{r cran_instruct, echo=FALSE, results='asis', eval=is_on_cran}
cat("You can install `{geodk}` from CRAN with:")
```
```{r cran_code, eval=FALSE, include=is_on_cran}
install.packages("geodk")
```
```{r r_universe_instruct, echo=FALSE, results='asis'}
if (is_on_cran) {
cat("Or you can install the latest pre-release version of `{geodk}` from r-universe with:")
} else if (!is_on_cran) {
cat("You can install `{geodk}` from r-universe with:")
}
```
```{r r_universe, eval=FALSE}
install.packages(
"geodk",
repos = c(
ropengov = "https://ropengov.r-universe.dev",
getOption("repos")
)
)
```
You can install the latest development version of `{geodk}` from [GitHub](https://github.com/rOpenGov/geodk) with:
``` r
# install.packages("devtools")
devtools::install_github("rOpenGov/geodk")
```
## Functions
`{geodk}` provides to main sets of functions:
- Data retrieval
- Plotting
### Plotting
The plotting functions include `plot_denmark()` which easily plots a basic map of Denmark and returns it as a `{ggplot2}` object for you to edit. It also includes `plot_region()` and `plot_municipality()` which plots a subset of Denmark with focus on provided regions or municipalities.
```{r example}
library(geodk)
plot_denmark()
```
```{r}
region <- plot_regions(region = c("Region Nordjylland", "Region Midtjylland"))
```
```{r}
municipality <- plot_municipalities(municipality = c("Aarhus", "Favrskov", "Vejle"))
```
```{r}
library(patchwork)
region + municipality
```