babaknaimi / sdm

sdm is an extensible framework to develop species distributions models using individual and community-based approaches, generate ensembles of models, evaluate the models, and predict species potential distributions in space and time.
21 stars 5 forks source link

Error in o[[1]]: Index out of bounds - displayed with getVarImp(model) #23

Closed maxsivertsen closed 9 months ago

maxsivertsen commented 9 months ago

Hi! So first of all, thank you for making such a cool package! It's really interesting seeing what can be done with it.

Currently however, I am running into some troubles with trying to determine the variable importance. I have created a model with formula:

species_1 + species_2 + species_3 + species_4 ~ env_variable_1 + env_variable_2 + env_variable_3 + env_variable_4 + time(year_month)

model <- sdm(  species_1 + species_2 + species_3 + species_4 ~ env_variable_1 + env_variable_2 + env_variable_3 + env_variable_4 + time(year_month),
data = sdm_data_format,
methods = rf,
replication = "sub",
test.percent = 30)

This then generates the following error code

Error in o[[1]]: Index out of bounds

I would be extremely thankful if somebody was able to provide an explanation for this. Thanks in advanced for your time reading this question!

kind regards max

maxsivertsen commented 9 months ago

Nevermind, I just looked up the function in the Helper. I'm new to coding. Sorry if this bothers anybody!