Can't install caret package - r

I'm not sure what's happening here but the caret package is not installing properly. I realize similar problems have been posted before but I can't figure it out.
install.packages("caret")
library(caret)
Error: package or namespace load failed for ‘caret’ in get(Info[i, 1], envir = env):
cannot open file 'C:/Users/John Compton/Documents/R/win-library/3.6/MASS/R/MASS.rdb': No such file or directory
So I've been trying to figure this out. I have the fully updated R 3.6.1, I also ran a thing that I've since lost of like install.packages("caret", repos = "cran/....", c = ("Dependencies", "Suggestions")) which took about 30 minutes and installed like every suggested package, so I don't know what the error could be. How do I fix the error with this package?
Edit: To include the install.package call
> install.packages("caret")
Installing package into ‘C:/Users/John Compton/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/caret_6.0-84.zip'
Content type 'application/zip' length 6237886 bytes (5.9 MB)
downloaded 5.9 MB
package ‘caret’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\John Compton\AppData\Local\Temp\RtmpGuKafa\downloaded_packages
>

Related

"Powder" from Github not installing (RStudio)

I'm trying to run this piece of code from a Github read.me file
## Install
```{r,eval=FALSE}
#install.packages('devtools')
devtools::install_github('jeff324/powder',build_vignettes = TRUE)
```
However. I keep getting this error message back in the console:
Downloading GitHub repo jeff324/powder#HEAD
Installing 1 packages: tibble
Installing package into ‘C:/Users/tessc/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/tibble_3.0.6.zip'
Content type 'application/zip' length 836388 bytes (816 KB)
downloaded 816 KB
package ‘tibble’ successfully unpacked and MD5 sums checked
Error: Failed to install 'powder' from GitHub:
(converted from warning) cannot remove prior installation of package ‘tibble’
>
Does anyone know what might be happening?
First thing I do when I get these types of errors is to Restart R. Go to Session -> Restart R. If that doesn't work, try opening a brand new session in R Studio. I was just able to install this package. So fundamentally, it is working.

Error in library(ggplot2) : There is no package called 'ggplot2'

I'm new to R and I'm just trying to get through some tutorials.
When I try installing ggplot2, I get this error.
Error in library(ggplot2) : There is no package called 'ggplot2'
I tried these in R and RStudio.
install.packages("ggplot2", dep=T)
install.packages('ggplot2', repos='http://cran.us.r-project.org')
remove.packages("ggplot2")
but I get the error
(Error in remove.packages : there is no package called 'ggplot2')
This is what I get from install.packages("ggplot2")
> install.packages("ggplot2")
Installing package into ‘.../R/win-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
'lib = ".../R/win-library/3.4"' is not writable
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/ggplot2_2.2.1.zip'
Content type 'application/zip' length 2784566 bytes (2.7 MB)
downloaded 2.7 MB
package ‘ggplot2’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘ggplot2’
The downloaded binary packages are in
C:...\AppData\Local\temp\RtmpqaGNpr\downloaded_packages
I removed all ggplot2 files manually then tried to install again. Here's my result.
> install.packages("ggplot2")
Installing package into ‘.../R/win-library/3.4’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://ftp.osuosl.org/pub/cran/bin/windows/contrib/3.4/ggplot2_2.2.1.zip'
Content type 'application/zip' length 2784566 bytes (2.7 MB)
downloaded 2.7 MB
package ‘ggplot2’ successfully unpacked and MD5 sums checked
Warning: unable to move temporary installation ‘...\R\win-library\3.4\file26b43a54980\ggplot2’ to ‘...\R\win-library\3.4\ggplot2’
The downloaded binary packages are in
C:...\AppData\Local\temp\Rtmpq0T9a6\downloaded_packages
> library(ggplot2)
Error in library(ggplot2) : there is no package called ‘ggplot2’
> library("ggplot2")
Error in library("ggplot2") : there is no package called ‘ggplot2’
These code was run using R 3.4.2
Steps
Go To Tools
Install Packages
In Packages Text Box Type ggplot2
Check the checkbox install dependencies
When having this issue I would suggest :
try turning it off and on again
update R to last version if possible
remove manually all the folders related to the relevant package and retry the installation
change your default library location : How do you change library location in R?
Try launching R client directly from command prompt, then issue the instruction:
install.packages("ggplot2", lib="C:/Users/YourUser/Documents/R/win-library/3.3")
You need to update your R version and do this but you'll need install all packages again:
Tool > Global Options > R version (CHANGE) > Select "Use your machine's default version of R..."

Persistent problems installing the car package in R

I'm having problems installing the package car in R.
There are previous posts on the topic, including this one and this other one.
I have followed the suggestions I've come across so far without success. I am using R Version 3.2.2. and RStudio.
This is the message I get:
install.packages("car")
Installing package into ‘C:/Users/.../Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/car_2.1-3.zip'
Content type 'application/zip' length 1447213 bytes (1.4 MB)
downloaded 1.4 MB
package ‘car’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\...\AppData\Local\Temp\Rtmpc3xr5i\downloaded_packages
If I check I get,
?car
No documentation for ‘car’ in specified packages and libraries:
you could try ‘??car’
I tried installing it from R with Install packages from local zip drives, and looking for the zip in C:\Users\...\AppData\Local\Temp\Rtmpc3xr5i\downloaded_packages, but this is the result:
library(car)
Error in library.dynam(lib, package, package.lib) :
DLL ‘SparseM’ not found: maybe not installed for this architecture?
In addition: Warning message:
package ‘car’ was built under R version 3.2.5
Error: package or namespace load failed for ‘car’
I did try installing SparseM even before posting the OP without success:
> install.packages("SparseM")
Installing package into ‘C:/Users/.../Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/SparseM_1.7.zip'
Content type 'application/zip' length 795531 bytes (776 KB)
downloaded 776 KB
package ‘SparseM’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\...\AppData\Local\Temp\Rtmpc3xr5i\downloaded_packages
> ?SparseM
No documentation for ‘SparseM’ in specified packages and libraries:
you could try ‘??SparseM’
Follow up:
After a comment regarding R version 3.2.3 I thought it would be an easy fix to just download this version, install, and erase 3.2.2. The problem then is that RStudio did not seem to work. I un-installed and re-installed R-studio, and now I get this when opening R studio:
Without knowing what version of the car package you're using, it's hard to know exactly what the source of the problem is. It seems likely, however, that you haven't installed the proper version of the pbkrtest, on which the Rcmdr package depends.
Is there a compelling reason not to upgrade everything to their current versions, including R, all packages, and RStudio?
Best,
John

R-Studio - installing package knn error

I try to install the kknn package in R. It downloads the folder but whenever I use library(kknn) I get:
Error in library(kknn) : there is no package called ‘kknn’
install.packages("kknn") Installing package into ‘C:/Users/Ed/Documents/R/win-library/3.2’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/kknn_1.3.0.zip' Content type 'application/zip' length 321517 bytes (313 KB) downloaded 313 KB
package ‘kknn’ successfully unpacked and MD5 sums checked Warning in install.packages : cannot remove prior installation of package ‘kknn’
The downloaded binary packages are in C:\Users\Ed\AppData\Local\Temp\RtmpWClNdR\downloaded_packages
library(kknn) Error in library(kknn) : there is no package called ‘kknn’
Any suggestions?
Many thanks
Ed
You may try:
install.packages("kknn")
library(kknn)
Based on your edit:
goto R/win-library/3.2 folder, find the folder kknn and delete it. restart your R session then reinstall the package.
install.packages(kknn)
library(kknn)

Issue loading 'dplyr' packages

All
I am trying to install and load 'dplyr' packages so that I can start to manipulate data at ease. Here is what I did and the error messages I got.
install.packages("dplyr")
Installing package into ‘C:/Users/YingHaw/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/dplyr_0.4.1.zip'
Content type 'application/zip' length 2596780 bytes (2.5 MB)
opened URL
downloaded 2.5 MB
package ‘dplyr’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\YingHaw\AppData\Local\Temp\Rtmp4KMRy3\downloaded_packages
library("dplyr")
Error in get(Info[i, 1], envir = env) :
cannot open file 'C:/Users/YingHaw/Documents/R/win-library/3.1/Rcpp/R/Rcpp.rdb': No such file or directory
Error: package or namespace load failed for ‘dplyr’
Can someone tell me what possibly went wrong?
Anson
Looks like you're facing issues in installing the dplyr package. Better remove both the packages plyr and dplyr (if already installed)and then try again installing it. if not better update your rstudio version and then try installing it
I have previously faced these issues but after removing and reinstalling it, that works.

Resources