Is there a way in biomod2 to do future projections with climate variables that are different?

Ok so, I am using the 'biomod2' package for species current distributions modeling as well as future distribution modelling. The climate data im using come from Worldclim.com. For current data all the bioclimatic variables can be downloaded individually while the future ones are combined into one .tif file. When I try to project with the future data I get an error message that states
`Error in .fun_testIfIn(TRUE, "names(new.env)", names(new.env), bm.mod@expl.var.names) :

names(new.env) must be 'bio_4', 'bio_9', 'bio_10', 'bio_14', 'bio_15', 'bio_16' or 'bio_17`

One way to solve this would be to get matching data but I cant seem to find it in worldclim. Is there any way to bypass this using the commands offered in biomod2?

The variable names in the future data must conform to the names in the calibrated model. See here. Use str() to inspect each object for the names being used, then determine which names in current map to which names in future.

So, for example,

names(current)
names(future)

Assuming that variables A & B in current mapped to variables E and F in future in data frame columns number 11 & 13

colnames(future)[11] <- "A"
colnames(future)[13] <- "B"
1 Like

Hey! Thanks for the reply I understand. I need further clarification on something: If the both the current and future variables are supposed to have the same names how will I be able to insert them into R without overlap and confusion on my end?

You are right to an extent —variable names in the same object, such as a data frame, cannot have the same names. But they can in separate objects, such as a pair of data frames.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.