data(rotif.env)
names(rotif.env)
# identify rotifer data in the Eastern and Western hemispheres:
unique(rotif.env$CONTINENT)
rotif.env$HEMISPHERE <- "Eastern"
rotif.env$HEMISPHERE[rotif.env$CONTINENT %in%
c("NORTHERN_AMERICA", "SOUTHERN_AMERICA")] <- "Western"
head(rotif.env)
# separate the rotifer data into hemispheres
east.hem <- rotif.env[rotif.env$HEMISPHERE == "Eastern", ]
west.hem <- rotif.env[rotif.env$HEMISPHERE == "Western", ]
# make models for 3 of the species in rotif.env based on their distribution
# in the Eastern hemisphere:
mods <- multGLM(east.hem, sp.cols = 18:20, var.cols = 5:17,
id.col = 1, step = FALSE, FDR = FALSE, trim = FALSE)
# get the models' predictions for the Western hemisphere dataset:
preds <- getPreds(west.hem, models = mods$models, P = TRUE,
Favourability = TRUE)
head(preds)
Run the code above in your browser using DataLab