inbo / n2khab

R package with preprocessing functions and standard reference data for Flemish Natura 2000 (N2K) habitat (HAB) analyses
https://inbo.github.io/n2khab
GNU General Public License v3.0
2 stars 1 forks source link

textdata updates #161

Closed florisvdh closed 2 years ago

florisvdh commented 2 years ago
> library(git2rdata)
> library(magrittr)
> scheme_types_new <- read_vc("scheme_types", "inst/textdata/")
> system("git show v0.6.0:inst/textdata/scheme_types.tsv", intern = TRUE) %>% 
+     writeLines(file.path(tempdir(), "scheme_types.tsv")) 
> system("git show v0.6.0:inst/textdata/scheme_types.yml", intern = TRUE) %>% 
+     writeLines(file.path(tempdir(), "scheme_types.yml")) 
> scheme_types_old <- read_vc("scheme_types", tempdir())
> 
> # LINES PRESENT ONLY BEFORE
> scheme_types_old %>% 
+     dplyr::anti_join(scheme_types_new, by = c("scheme", "type", "typegroup"))
   scheme type      typegroup
1 GW_03.3 7210 GW_03.3_group3
> 
> # LINES PRESENT ONLY AFTER
> scheme_types_old %>% 
+     dplyr::anti_join(scheme_types_new, ., by = c("scheme", "type", "typegroup"))
   scheme type      typegroup
1 GW_03.3 7210 GW_03.3_group2
Source code only ```r library(git2rdata) library(magrittr) scheme_types_new <- read_vc("scheme_types", "inst/textdata/") system("git show v0.6.0:inst/textdata/scheme_types.tsv", intern = TRUE) %>% writeLines(file.path(tempdir(), "scheme_types.tsv")) system("git show v0.6.0:inst/textdata/scheme_types.yml", intern = TRUE) %>% writeLines(file.path(tempdir(), "scheme_types.yml")) scheme_types_old <- read_vc("scheme_types", tempdir()) # LINES PRESENT ONLY BEFORE scheme_types_old %>% dplyr::anti_join(scheme_types_new, by = c("scheme", "type", "typegroup")) # LINES PRESENT ONLY AFTER scheme_types_old %>% dplyr::anti_join(scheme_types_new, ., by = c("scheme", "type", "typegroup")) ```