Closed PetiteTong closed 2 years ago
Not sure what the problem with your ENMevaluate
error is, but cb2$occs.grp
should give you back a numeric vector that tells you which group each point is in, not the coordinates of the occurrence points. If you do something like occs[cb2$occs.grp == 1,]
, you'll get all the occurrence coordinates of the records that are in group 1. If you do extract()
this way, do you still see NAs?
thanks a lot, I tried the example again and realized I misunderstoodcb2$occs.grp
. Just like you say. So I wander that if my rasters in envs_stack
have the same cell size and the same extent, but the NA Values of the edge are not the same, could the ENMevaluate
work well? Could this be a problem for running ENMevaluate
?
Not sure I understand what you mean, but if you have occurrence points that land on the edge of a land grid cell and the other adjacent ones are ocean, for example, you'll need to either physically move it closer to the centroid of the land grid cell (i.e., fixing the georeferencing) or parameterize extract()
to return cell values by "touching" instead of by proximity to centroid. I am pretty sure the extract()
function in the terra
package (kind of like an update for raster
) can do this.
Hello, thanks a lot. When I checked the model and the predictors with dichotomy method, I found that there was no problem with the model, but adding the soil type (classification variable) in the predictors would report an error. I have marked this variable with as.factor
, and converted it into dataframe
to check the NA value, it had the same amount of NA value as other variables, why did it report an error when adding this variable? Its classification content is the number, such as "23120201". How should I deal with this layer of variables? Did you meet this problems before?
Using categorical variables does not cause errors for ENMevaluate()
, so that by itself shouldn't cause issues. There might be problems if some partition groups are missing categories or have different ones from the training data. If you have many categories this could be the case. But the initial error you had made it seem that the input occurrences all had NA when using extract()
. Are you still getting this error? Or is this a different issue?
yes,still get this error, only if without soil, there will be no error
yes, maybe some partition groups are missing categories or have different ones from the training data.
, I want to use block
or checkerboard2
method, if so , does that mean that I can only useK-fold
method?
I think there would be an issue if the training data is missing a category that the validation data has. This usually shouldn't happen if the categories are distributed normally around the study extent. However, if you do spatial cross-validation and one of the blocks is the only area with some land use category, for example, the model trained on the other land uses cannot make a prediction for the validation data. I haven't tested this, but I'm pretty sure it would be result in an error. If you try random k-fold, do you avoid the error?
yes, I will try to randomkfold and checkerboard2 method again.
block
doesn't fit my data, but checkerboard2
is OK! I will use it~ thanks a lot
Excellent -- please let me know if you have any issues.
Hi,
I'm struggling with an error message with ENMevaluate. I find that Patrick meet the same bug in 2019, I referent it but still have a problem. I used function "get.checkerboard" , and I extract by it, all data shows NA, but When I plot the occs.grp and bg.grp, all points are in the field with values, I also checked points in ArcGIS, I don't know how to deal with it, maybe I did something wrong I didn't realized, hope you could help me, Thanks!
Thanks, Petite Tong