0

I want to create species worldwide distribution map for 2000 species. I tried to write the following code, but don't know how to complete it for 2000 .csv files. I want to create separate maps for each species and save them all on my system. Any helps?

library(maptools)
library(rgeos)
library(raster)
library(rgdal)
library(dismo)
library(dplyr)

  #plot your observation points
  data("wrld_simpl")
 
  
  list.files(path = "D:/R_projects", full.names = TRUE) %>%
  
  #Import all files
    purrr::map(readr::read_csv) %>%
    occurrences <- purrr::map(readr::read_csv)
    
    plot(wrld_simpl)
    points(occurrences$decimalLongitude, occurrences$decimalLatitude, col="red", pch=1, cex=0.1)
  • Hi, Welcome to SO. You'll probably get a better response if you include sample data that stands-in for your .csv file, so people have something to work with when trying to help you. Is there a way to re-create what is contained in your .csv files that can be added to your questions post? Here are some [approaches](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) for how people might do this. – xilliam Jan 11 '22 at 11:38

0 Answers0