||
#install.packages(c('raster', 'rgdal', 'dismo', 'rJava')) # loads the dismo (distribution modeling) library #using an example file that is installed with the dismo package library(dismo) Xishu= gbif("Camptotheca", "acuminata") #Use '*' to download the entire genus. #Append '*' to the species name to get all naming variants #Xishu= gbif("Camptotheca", "acuminata",extent(85,125,10,55)) # how many rows and colums? dim(Xishu) #select the records that have longitude and latitude data colnames(Xishu) Xishu$lon XSgeo <- subset(Xishu, !is.na(lon) & !is.na(lat)) dim(XSgeo) #remove duplicated record dups <- duplicated(XSgeo[, c('lon', 'lat')]) XSfin=XSgeo[!dups,] dim(XSfin) # show some values #opne world simple map library(maptools) data(wrld_simpl) plot(wrld_simpl, xlim=c(85,125), ylim=c(10,55), axes=TRUE,col="light yellow") # restore the box around the map box() # plot points points(XSfin$lon, XSfin$lat, col='orange', pch=20, cex=0.75) # plot points again to add a border, for better visibility points(XSfin$lon, XSfin$lat, col='red', cex=0.75)
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-24 00:35
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社