Skip to content

Error in rf.modelSel #7

@jcarlis3

Description

@jcarlis3

Hi @jeffreyevans ,

I ran rf.modelSel back in 2017 in my sage-grouse research with Melanie et al. I'm dusting that analysis off, and Melanie pointed out that my MIR values should be 0-1, but several were negative. I see v2.2-0 has incorporated some bug fixes in that function, so I installed and attempted to re-run, but now get an error when running the updated rf.modelSel. I can reproduce the same error using the example in the help doc for rf.modelSel:

require(randomForest)
require(rfUtilities)

sessionInfo()
# R version 4.1.0 (2021-05-18)
# Platform: x86_64-w64-mingw32/x64 (64-bit)
# Running under: Windows 10 x64 (build 19042)
# 
# Matrix products: default
# 
# locale:
#   [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
# [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
# [5] LC_TIME=English_United States.1252    
# 
# attached base packages:
#   [1] stats     graphics  grDevices utils     datasets  methods   base     
# 
# other attached packages:
#   [1] rfUtilities_2.2-0   randomForest_4.6-14
# 
# loaded via a namespace (and not attached):
#   [1] compiler_4.1.0 tools_4.1.0 


# Example from rf.modelSel
data(airquality)
airquality <- na.omit(airquality)

xdata = airquality[,2:6]
ydata = airquality[,1]

#### Regression example

#### Using Breiman's original Fortran code from randomForest package
( rf.regress <- rf.modelSel(airquality[,2:6], airquality[,1], 
                            imp.scale="se") )

#### Using Wright's C++ code from ranger package
( rf.regress <- rf.modelSel(airquality[,2:6], airquality[,1], 
                            method="Wright") )

#### Classification example
ydata = as.factor(ifelse(ydata < 40, 0, 1))

#### Using Breiman's original Fortran code from randomForest package
( rf.class <- rf.modelSel(xdata, ydata, ntree=1000) )


# The above statement returnes this error:
# [1] "ntree"      "y"          "x"          "importance"
# Error in is.nan(errors) : default method not implemented for type 'list'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions