I have been trying to load CARET package for starting a machine learning course . It takes 4-5 hours to download but fails in the end. I am using R studio
Any help or tips as to what I am doing wrong?
Every time I get error message as below:
Loading required package: lattice
Error: package or namespace load failed for ‘caret’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘recipes’
Information about the R version I am using is below:
sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)
Matrix products: default
Random number generation:
RNG: Mersenne-Twister
Normal: Inversion
Sample: Rounding
Can you please be more specific? Do you get an error message? If so, post the complete output message you get when you try to install the recipes package.
I did try to load "ipred " package but I am getting errors again
install.packages("ipred", dependencies = TRUE)
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
package ‘ipred’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Rekha Rao\AppData\Local\Temp\RtmpQz4lBT\downloaded_packages
After I tried installing "ipred" I tried again to re-install recipes and got the same error message
installing source package 'recipes' ...
** package 'recipes' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'ipred' 0.9-11 is being loaded, but >= 0.9.12 is required
Calls: ... namespaceImportFrom -> asNamespace -> loadNamespace
Execution halted
ERROR: lazy loading failed for package 'recipes'
removing 'C:/Users/Rekha Rao/Desktop/R-3.6.3/library/recipes'
Warning in install.packages :
installation of package ‘recipes’ had non-zero exit status
Basically I am doing Harvard University Course. Trying to create Test and Training sets using CreateDataPartition and getting an error that there is no such function.
test_index <- createDataPartition(y, times = 1, p = 0.5, list = FALSE)
Error in createDataPartition(y, times = 1, p = 0.5, list = FALSE) :
could not find function "createDataPartition"
Thats y I am working backwards to understand what is causing this problem
This is the root cause, you need to install a newer version of the ipred package which is only available in source form for your R version. To install packages from source you need a compiler, for Windows systems this compiler is RTools, which is a separate software that you need to install in your system (not in R).
You can download older versions of RTools (suitable for your older R version) from here:
Although, I would recommend you to update your entire R environment (including base R, RTools and your package library) to the latest versions.
I am not a quick typist and posted after andresrcs!
You have successfully installed ipred, but it is still version 0.9-11 and you need 0.9-12. Because you are using an old version of R, 3.6.3, a compiled (binary) version of the newer 0.9-12 is not available on CRAN (CRAN has binaries of 0.9-12 for R 4.0 and R 4.1, the two most recent versions).
You could compile for R 3.6.3 from source but would need to install Rtools first (Rtools is the set of tools to compile packages from C/C++/Fortran code, it is not an R package). Another option is to update the version of R. This will let you install binary versions of packages from CRAN, making life much easier.