fitzLab-AL / gdm

R package for Generalized Dissimilarity Modeling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gdm.varImp sensitive to predictor names

JulFrey opened this issue · comments

Due to line 569 in the file gdm.variable.importance.R:
grepper <- grep(var, names(permVarDev))
the function gdm.varImp failes if the varible names are character subssets of each other. For example for varibles "var1" and "var10" grep returns both while searching for the first one. The function failes afterwards while trying:
varDevTab <- permVarDev[[grepper]]
with the error message: "Error in permVarDev[[grepper]] : recursive indexing failed at level 2"
I would suggest using:
grepper <- which(var == names(permVarDev))
at line 569 to search for an exact match.

Thanks, issue should be resolved in latest version on github (1.5.0-4).