rpackagerandom-forest

Unable to install the randomForest package


I am trying to install the randomForest package in RStudio and have not been able to do so successfully.

I tried the following code and got the error message further down below. I also tried to use the "Install Packages" function under "Tools" and could not find the randomForest package in CRAN. I can only see packages of "randomForestExplainer" "RandomForestsGLS" and "randomForestSRC"

install.packages("randomForest")

Warning in install.packages : package ‘randomForest’ is not available (for R version 3.6.1)

I would appreciate it if someone could kindly advise what went wrong. Thank you in advance.


Solution

  • The current release of randomForest requires R version 4.1.0 or newer. You are using R 3.6.1, which is three years old.

    The best thing for you to do is to update to the current R release, but if that is impossible for some reason, then you'll need to try to find an older version of randomForest and install that. This is likely to waste a lot of time, because it may depend on other old packages, etc. You can see what's available on this page: https://cran.r-project.org/src/contrib/Archive/randomForest/, but you'll have to download to find which versions of R are compatible.