Forum: help
Monitor Forum | Start New ThreadRE: BIOMOD_cv error: missing values and NaN's not allowed if 'na.rm' is FALSE [ Reply ] By: Maya Guéguen on 2022-05-06 07:53 | [forum:49392] |
Hello, This forum will soon no longer be checked. Please post your questions / comments / errors onto the biomod2 github : https://github.com/biomodhub/biomod2/issues Thanks in advance Maya |
BIOMOD_cv error: missing values and NaN's not allowed if 'na.rm' is FALSE [ Reply ] By: Luís Santiago on 2022-05-05 12:18 | [forum:49391] |
Hi, I am trying to run some model cross-validations to test overfitting. I keep coming across this error: "Error in quantile.default(data@coord[balance, 2], probs = seq(0, 100, : missing values and NaN's not allowed if 'na.rm' is FALSE" It turns out, my data is of the presence-only type and, thus, I create pseudo-absences: "deer2010_formatdata <- BIOMOD_FormatingData(resp.var = deerPoints2010['Presence'], resp.xy = coordinates(deerPoints2010_LonLat), expl.var = deerVariables.2010, resp.name = "Mazama 10", PA.nb.rep = 1, PA.nb.absences = nrow(deerPoints2010)*100, PA.strategy = 'random')" As far as I understand, during the data formatting step, several NAs are added. When I run data2010_formatdata@data.species, I can see that those NAs are where the pseudoabsences should be. I tried to unlist it and reclassify it as numeric, as well as using adding na.rm = TRUE, but these haven't worked. Does anybody know how to solve this? Thanks in advance, Luís |