# NOT RUN {
data(lynxjura)
map <- lynxjura$map
## We keep only "wild" indices.
tmp <- lynxjura$locs[,4]!="D"
locs <- lynxjura$locs[tmp, c("X","Y")]
hist(map, type = "l")
## The variable artif is far from symetric
## We perform a square root transformation
## of this variable
## We therefore normalize the variable 'artif'
map[,4] <- sqrt(map[,4])
hist(map, type = "l")
## We prepare the data for the ENFA
(dataenfa1 <- data2enfa(map, locs))
## We then perform the PCA before the ENFA
pc <- dudi.pca(dataenfa1$tab, scannf = FALSE)
## The object 'pc' contains the transformed table (i.e.
## centered so that all columns have a mean of 0
## and scaled so that all columns have a variance of 1
## 'pc' also contains the weights of the habitat variables,
## and the weights of the pixels in the analysis
(enfa1 <- enfa(pc, dataenfa1$pr,
scannf = FALSE))
hist(enfa1)
hist(enfa1, scores = FALSE, type = "l")
## randomization test and scatterplot
# }
# NOT RUN {
(renfa <- randtest(enfa1))
plot(renfa)
scatter(enfa1)
# }
Run the code above in your browser using DataLab