I have around 4000 rasters (tif) all in a single folder. Each tif shows the distribution of a species. The filename of the tif is the species name. I want to make species richness maps from subsets of the species in the folder. I have a csv file with the filenames of the species i want to subset. How do i read into r the subset of tifs based on the filenames listed in a csv? I also need to export the subset of tifs to another folder.
I have done a lot of searching online but can't find anything that helps.
Thanks so much for your help!!
Here are my tif files:
> head(f)
[1] "Abies_alba.tif" "Abies_cephalonica.tif" "Abies_nebrodensis.tif" "Ablepharus_budaki.tif"
[5] "Ablepharus_chernovi.tif" "Ablepharus_kitaibelii.tif"
Here is my csv:
> head(csv)
BINOMIAL
1 Abies_alba
2 Abies_cephalonica
3 Abies_nebrodensis