I had already done some niche modeling with maxent() and doing it step by step i don't have any problem. when i try to do it in a loop for more models just give this Error:
Error in UseMethod("predict") : no applicable method for 'predict' applied to an object of class "data.frame"
For example:
I have a data base like this (this is like a summary)
xm <- maxent(capas, SP1, path=paste("Maxent_",sub(" ","_",as.character(SP$Especie[1])),sep=""))
px = predict(capas, xm, progress='')
That works perfectly but when a do it on a loop like this:
for(i in 1:10) {
MT=maxent(CAPAS,subset(BioSp,BioSp$Sp==Spp[i],select=c(2,3)), path=paste("Modelos/Maxent_",
sub(" ","_",as.character(Spp[i])),sep=""))
MODEL=predict(CAPAS,MT,progress="windows",filename=paste(model,"asc",sep="."), overwrite=T)
}
Gives this problem:
Error in UseMethod("predict") : no applicable method for 'predict' applied to an object of class "data.frame"
Early today was working perfectly but now it doesn't work
Please i need help with this, I don't know whats happening with the class of the object. I didn't change anything on this and started to give me problems.