Académique Documents
Professionnel Documents
Culture Documents
r] 1/2
bioclim[[1]]
plot(bioclim[[1]])
install.packages("fBasics")
library(fBasics)
colorT <- rev(divPalette(n=100, name="RdYlBu"))
colorP <- seqPalette(n=100, name="Blues")
par(mfrow=c(2, 1))
plot(bioclim[[1]]/10, col=colorT)
title("Températures Moyennes Annuelles (°C) 1950-2000")
plot(bioclim[[12]], col=colorP)
title("Précipitations Annuelles (mm) 1950-2000")
temp <- getValues(bioclim[[1]])
tsea <- getValues(bioclim[[4]])
prec <- getValues(bioclim[[12]])
psea <- getValues(bioclim[[15]])
bio <- as.data.frame(temp)
bio[, "tsea"] <- tsea
bio[, "prec"] <- prec
bio[, "psea"] <- psea
# Récupérer l'information d'appartenance aux différents biomes terrestres en
# téléchargeant le Shapefile intitulé "wwf_terr_ecos" sur le site :
# http://worldwildlife.org/publications/terrestrial-ecoregions-of-the-world
# Sauvegarder l'ensemble des fichiers du Shapefile dans le répertoire de
# travail(cf. "getwd()") avant de le charger grÂce au package "maptools"
install.packages("maptools")
library(maptools)
teow <- readShapePoly("wwf_terr_ecos")
# Vérifier que la projection de l'objet "teow" est identique à celle de l'objet
# "bioclim" soit prj="+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0"
bioclim[[1]]
teow
str(teow@data)
teow <- rasterize(teow, bioclim[[1]], field="BIOME", fun="last")
biom <- getValues(teow)
bio[, "biom"] <- biom
bio <- na.omit(bio)
monACP <- dudi.pca(bio[, 1:4], center=TRUE, scale=TRUE, scannf=FALSE,
nf=dim(bio[, 1:4])[2])
s.corcircle(monACP$co)
plot(monACP$li[, 1], monACP$li[, 2], type="n", xlab="CP1", ylab="CP2")
tropic <- which(bio$biom==1|bio$biom==2|bio$biom==3|bio$biom==7)
temperate <- which(bio$biom==4|bio$biom==5|bio$biom==8)
boreal <- which(bio$biom==6|bio$biom==11)
mediter <- which(bio$biom==12)
points(monACP$li[tropic, 1], monACP$li[tropic, 2], col="forestgreen", pch=19)
points(monACP$li[temperate, 1], monACP$li[temperate, 2], col="brown", pch=19)
points(monACP$li[boreal, 1], monACP$li[boreal, 2], col="blue", pch=19)
points(monACP$li[mediter, 1], monACP$li[mediter, 2], col="red", pch=19)
legend(-3, -6, c("Tropical biomes", "Temperate biomes", "Boreal biomes",
"Mediterranean biomes"), col=c("forestgreen", "brown", "blue", "red"),
pch=c(19, 19, 19, 19))
# Quitter
q()