rm(list = ls())
library(readxl)
library(raster)
library(sp)
bio1 <-‘wc2.1_2.5m_bio_1.tif’ # annual mean temperature
bio4 <-‘wc2.1_2.5m_bio_4.tif’ #temperature seasonality (standard deviation *100)
bio7 <- ‘wc2.1_2.5m_bio_7.tif’ #temperature annual range [Max Temperature of Warmest Month - Min Temperature of Coldest Month]
bio12 <-‘wc2.1_2.5m_bio_12.tif’# annual precipitation
coordinate <- read_excel(“你的坐标点数据”)
lats <- coordinate
L
a
t
l
o
n
s
<
−
c
o
o
r
d
i
n
a
t
e
Lat lons <- coordinate
Latlons<−coordinateLon
coords <- data.frame(x=lons,y=lats)
mat <- raster(bio1)
season <- raster(bio4)
trange <- raster(bio7)
map <- raster(bio12)
temp <- extract(mat,coords)
seasonality <- extract(season,coords)
range <- extract(trange, coords)
prec <- extract(map,coords)