inbo / riparias-prep

Preparatory scripts and data management for the RIPARIAS workflow
MIT License
0 stars 1 forks source link

Do climate matching with all crayfish on gbif #5

Closed SanderDevisscher closed 3 years ago

SanderDevisscher commented 3 years ago

Pending the complete taxonomic list, would it be useful to carry out the climate matching analysis on all the crayfish species available in the GBIF database ?

If you would provide me with a list of crayfish families (example https://www.gbif.org/species/8670) to consider with the corresponding taxonkeys I can do a gbif download based on this.

=> firstly however I would like to focus on the rework for the higher resolution raster files. I'll open a new issue for this analysis.

Originally posted by @SanderDevisscher in https://github.com/inbo/riparias-prep/issues/1#issuecomment-810311413

adrienlatli commented 3 years ago

@SanderDevisscher : According to the World Register of Marine Species crayfish families are Astacidae, Cambaridae and Parastacidae https://www.gbif.org/species/8022 https://www.gbif.org/species/4479 https://www.gbif.org/species/8670

Be careful, some species have multiples names. It would be useful to regroup them (I create a new post "issue" for the synonyms and climate matching approach) I will be in holydays next week but RomainWilleput can help if needed.

SanderDevisscher commented 3 years ago

Steps:

if(dir.exists("./Exoten/Chinese_wolhandkrab/Input/")){
  filelist <- dir("./Exoten/Chinese_wolhandkrab/Input/", 
                  pattern = ".zip", 
                  full.names = TRUE)
  filelist_info <- file.info(filelist)
  filelist_info <- filelist_info %>% 
    filter(ctime == max(ctime, na.rm = TRUE)) 

  if(nrow(filelist_info) == 1){
    old_data <- rownames(filelist_info)
  }else{
    warning("Multiple zip-files are the same age. downloading new data")
    old_data <- ""
  }
}else{
  old_data <- ""
}

&

rerun <- menu(choices = c("Yes", "No"), 
              title = "Download new data?",
              graphics = TRUE)
if(old_data == "" || rerun == 1){ }
SanderDevisscher commented 3 years ago

5_all_crayfish_cm - branch