-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add built in datasets to the package
- Loading branch information
1 parent
533e1c3
commit 65f3696
Showing
11 changed files
with
172 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#' Danish regions | ||
#' | ||
#' A `sf` dataset providing geometry for the danish regions | ||
#' | ||
#' @format ## `regions` | ||
#' An object of classes `sf` and `data.frame` with 5 rows and 8 columns: | ||
#' \describe{ | ||
#' \item{code}{Unique code} | ||
#' \item{name}{The Danish name of the region} | ||
#' \item{nuts2}{EU nuts division} | ||
#' \item{source_changed}{When was the source last changed on the data-provider's side} | ||
#' \item{visualcenter_x, visualcenter_y}{Visual center of the polygon in WGS84} | ||
#' \item{geometry}{Polygons for each region} | ||
#' \item{last_update}{When was the data in the package last updated by maintainers} | ||
#' } | ||
"regions" | ||
|
||
#' Danish municipalities | ||
#' | ||
#' A `sf` dataset providing geometry for the danish municipalities | ||
#' | ||
#' @format ## `municipalities` | ||
#' An object of classes `sf` and `data.frame` with 99 rows and 9 columns: | ||
#' \describe{ | ||
#' \item{code}{Unique code} | ||
#' \item{name}{The Danish name of the municipality} | ||
#' \item{region_code}{The unique code of the region that this municipality is located in} | ||
#' \item{region_name}{The name of the region that this municipality is located in} | ||
#' \item{source_changed}{When was the source last changed on the data-provider's side} | ||
#' \item{visualcenter_x, visualcenter_y}{Visual center of the polygon in WGS84} | ||
#' \item{geometry}{Polygons for each municipality} | ||
#' \item{last_update}{When was the data in the package last updated by maintainers} | ||
#' } | ||
"municipalities" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
regions <- dawaR::get_map_data("regioner") |> | ||
dplyr::rename(code = kode, | ||
name = navn, | ||
last_changed = ændret, | ||
visualcenter_x = visueltcenter_x, | ||
visualcenter_y = visueltcenter_y, | ||
source_changed = ændret) |> | ||
dplyr::select(-c(dagi_id, geo_ændret, geo_version)) |> | ||
dplyr::mutate(last_update = lubridate::today()) | ||
|
||
usethis::use_data(regions, compress = "xz", overwrite = TRUE) | ||
|
||
municipalities <- dawaR::get_map_data("kommuner") |> | ||
dplyr::rename(code = kode, | ||
name = navn, | ||
region_code = regionskode, | ||
region_name = regionsnavn, | ||
last_changed = ændret, | ||
visualcenter_x = visueltcenter_x, | ||
visualcenter_y = visueltcenter_y, | ||
source_changed = ændret) |> | ||
dplyr::select(-c(dagi_id, geo_ændret, geo_version, | ||
udenforkommuneinddeling)) |> | ||
dplyr::mutate(last_update = lubridate::today()) | ||
|
||
usethis::use_data(municipalities, compress = "xz", overwrite = TRUE) |
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters