rmaxent

predict function for MaxEnt(Software R)


I'm trying to use predict function for predict potencial occurrence points in space transfer. For this I using dismo package loaded with presence points in original space, 17 raster layers for original space and 17 raster layer for transfer space. All the rasters are identicals in extent, grid resolution and dimension, differing only in geographic coords. The original space and the transfer space are located in different continents and I have used kfold techinque for partitioning of my samples in training and testing.

I fit my maxent model with:

me<-maxent(predictor, training)

but, I can't project my fit model in the transfer space, returning:

pred<-predict(me,predictor2)
    Erro em .local(object, ...) : missing layers (or wrong names)

*predictors 1 and 2 are in raster stack file

*All the directories were correctly choosen, and the files is found into the directory.

*both, stack contain the same variable in for each geographic space


Solution

  • That points to 'wrong names' then. This could fix that

    names(predictor2) <- names(predictor)
    

    But do make sure that this is correct (that is, that the two RasterStack objects have the same layers in the same order), by inspecting

    names(predictor2)
    names(predictor)