-
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 logic to load correct version of inbotheme
- Loading branch information
1 parent
599318a
commit b534f80
Showing
1 changed file
with
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,37 @@ library(rgbif) # To get taxa from publisehd unified checklist | |
library(sf) # To work with spatial data | ||
``` | ||
|
||
```{r load correct version of INBOtheme} | ||
if(Sys.getenv("amiabot") != "yes"){ | ||
print("Executor of the script is a human >> checking INBOtheme version") | ||
# determine the loaded INBOtheme version | ||
loaded_inbotheme <- installed.packages() %>% | ||
as_tibble() %>% | ||
filter(Package == "INBOtheme") | ||
loaded_inbotheme_version <- loaded_inbotheme$Version | ||
if(is_empty(loaded_inbotheme_version)){ | ||
print("INBOtheme is not installed >> installing INBOtheme") | ||
devtools::install_github("inbo/[email protected]") | ||
} | ||
if(loaded_inbotheme_version != "0.5.8"){ | ||
print("INBOtheme version is not correct >> loading correct version") | ||
# remove installed INBOtheme | ||
remove.packages("INBOtheme") | ||
# load correct version of INBOtheme | ||
devtools::install_github("inbo/[email protected]") | ||
}else{ | ||
print("Correct INBOtheme version is loaded") | ||
} | ||
}else{ | ||
print("Executor of the script is a bot >> correct INBOtheme version is loaded") | ||
} | ||
library(INBOtheme) | ||
``` | ||
|
||
# Get data | ||
|
||
## read utm1_bel_with_regions file | ||
|