-
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.
Merge pull request #13 from inbo/11-new-dataset-boswachterijen
11 new dataset boswachterijen
- Loading branch information
Showing
8 changed files
with
220 additions
and
3 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,15 @@ | ||
#' Boswachterijen | ||
#' | ||
#' Spatiale en andere informatie (o.a. telefoonummers) van de boswachterijen van | ||
#' ANB. | ||
#' | ||
#' @format ## `boswachterijen` | ||
#' En sf data frame with 98 rijen and 11 kolommen per jaar: | ||
#' \describe{ | ||
#' \item{Regio}{Beheerregio} | ||
#' \item{Naam}{Naam van de boswachter} | ||
#' \item{telefoon}{Telefoon nr van de boswachter} | ||
#' ... | ||
#' } | ||
#' @source <https://www.who.int/teams/global-tuberculosis-programme/data> | ||
"boswachterijen" |
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
title: "update_boswachterijen" | ||
author: "Sander Devisscher" | ||
date: "2024-04-30" | ||
output: html_document | ||
--- | ||
|
||
Script om boswachterijen.rda up te daten | ||
boswachterijen.rda bevat de boswachterijen van ANB voor een specifiek jaar. | ||
|
||
```{r libraries} | ||
library(sf) | ||
``` | ||
|
||
```{r get filelist} | ||
rawdata_path <- "./data_raw/boswachterijen/" | ||
filelist <- dir(rawdata_path, | ||
pattern = ".geojson", | ||
full.names = TRUE) | ||
jaren <- "" | ||
for(f in filelist){ | ||
temp_file <- st_read(f) | ||
filename_redux <- gsub(pattern = rawdata_path, | ||
replacement = "", | ||
f) | ||
jaar <- gsub(pattern = ".geojson", | ||
replacement = "", | ||
filename_redux) %>% | ||
snakecase::to_snake_case() | ||
assign(jaar, temp_file) | ||
if(jaren == ""){ | ||
jaren <- jaar | ||
}else{ | ||
jaren <- c(jaren, jaar) | ||
} | ||
} | ||
boswachterijen <- list() | ||
for(j in 1:length(jaren)){ | ||
temp_list <- list(x = get(jaren[j])) | ||
names(temp_list)[1] <- jaren[j] | ||
if(length(boswachterijen)==0){ | ||
boswachterijen <- c(temp_list) | ||
}else{ | ||
boswachterijen <- c(boswachterijen, temp_list) | ||
} | ||
} | ||
save(boswachterijen, | ||
file = "./data/boswachterijen.rda", | ||
compress = "xz") | ||
``` | ||
|