sjevelazco/flexsdm

Error in data_ens[[2]] : subscript out of bounds

dannyvelezv opened this issue · 9 comments

HI,

Any ideas why I am getting this error when trying to apply esm_max()? How can I solve it?

Code:
esm_max_t1 <- esm_max(
data = ex_spxy2,
response = "pr_ab",
predictors= c("PC1", "PC2"),
partition = ".part",
thr = NULL,
background = ex_bg2,
clamp = TRUE,
classes = "lq",
pred_type = "cloglog",
regmult = 2.5
)

Presences, background points and predictors attached,

Thanks
background.txt
Presencias.txt
somevar.zip

How did you solve it? I have the same error, #338

Did you solve it? Same error here, only for esm_max

Hi all
Sorry, I forgot to work on this bug. I will work on this and let you know when it is fixed. Thanks

Please,
Can one of you send a dataset to help me reproduce this error? A txt with presences (or presences/absences), .partition, and environmental data, and another .txt with background points with same columns. I can´t reproduce the error with the dataset provided by @dannyvelezv . Thanks

Solved in #338, did this not work here? It was just an indexing problem that you could solve through just using more predictors

The problem is you are using the esm_ family function with two predictors. It makes no sense because it is the same as constructing a single model with fit_ or tune_ family function. I added an error message to all esm_ functions. So, use tune or fit functions. Thank yo so much for reporting this error.
Best

@sjevelazco, just have a look into this small project: https://github.com/KonstiDE/FlexSDM
Whilst running, just remove two of the predictor variables you dont like in the esm function family in flexsdm.R, Line 172 and following