R install package caret [duplicate] - r

I am trying to load ggplot2. I am using Windows 7. R tells me that ggplot2 has loaded successfully but when I try to use the library function it says it cannot find ggplot2. Here is what it says.
install.packages("ggplot2")
Installing package into ‘C:/Users/Owner/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/ggplot2_1.0.0.zip'
Content type 'application/zip' length 2675581 bytes (2.6 Mb)
opened URL
downloaded 2.6 Mb
package ‘ggplot2’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Owner\AppData\Local\Temp\RtmpyesS1j\downloaded_packages
I then tried to use the library function and got this message:
library("ggplot2")
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘munsell’
Error: package or namespace load failed for ‘ggplot2’
> head(diamonds)
Error in head(diamonds) : object 'diamonds' not found
I hope someone has an idea about what I have done wrong.

You should have executed this:
install.packages("ggplot2", dependencies=TRUE)

Related

ggpmisc Error: package or namespace load failed for ‘ggpmisc’

I am trying to use the library ggpmisc and even though the installation went okey it gives me an error when I try to open the library. How can I solve it?
install.packages("ggpmisc")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/ggpmisc_0.4.5.zip'
Content type 'application/zip' length 1349360 bytes (1.3 MB)
downloaded 1.3 MB
package ‘ggpmisc’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\dkafe\AppData\Local\Temp\Rtmpkh620g\downloaded_packages
library(ggpmisc)
Error: package or namespace load failed for ‘ggpmisc’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘conquer’ In addition: Warning message:
package ‘ggpmisc’ was built under R version 4.1.3

R Studio error calling installed library on windows : there is no package called 'utf8'

I tried to install package ggplot2in R Studio Desktop Windows. But I got the error message when I used the library :
> install.packages("ggplot2")
Installing package into ‘C:/Users/Rifqi/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/ggplot2_3.3.3.zip'
Content type 'application/zip' length 4068844 bytes (3.9 MB)
downloaded 3.9 MB
package ‘ggplot2’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Rifqi\AppData\Local\Temp\Rtmp005k6i\downloaded_packages
> library(ggplot2)
Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘utf8’
>
What should I do to fix this problem?
Install package utf8 and then try reinstall ggplot2 and it should be fixed
install.packages("utf8")

Can't load library R Studio

I am trying to install the ggmap library:
install.packages("ggmap")
library(ggmap)
This is what I get though:
Installing package into ‘my path’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/ggmap_2.6.1.zip'
Content type 'application/zip' length 4563151 bytes (4.4 MB)
downloaded 4.4 MB
package ‘ggmap’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
my path
> library(ggmap)
Error: package or namespace load failed for ‘ggmap’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘maps’
It used to work, then I don't know what happened and it stopped working. Any ideas ? I tried removing the package then installing it again but it still doesn't work
Next time when installing packages, try this:
install.packages("ggmap",dependencies=TRUE)
library(ggmap)
The extra argument will make sure all the necessary dependencies are also installed.

Unable to Install Swirl in "R"

Please help me in installing and loading the swirl package in R.
When I type:
install.packages("swirl")
I get:
Installing package into ‘C:/Users/Abdullah/Documents/R/win-library/3.3' (as ‘lib’ is unspecified)
trying URL 'https://ftp.iitm.ac.in/cran/bin/windows/contrib/3.3/swirl_2.4.2.zip'
Content type 'application/zip' length 212366 bytes (207 KB)
downloaded 207 KB
package ‘swirl’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Abdullah\AppData\Local\Temp\RtmpeOgzVN\downloaded_packages
The package shows as being installed:
packageVersion("swirl")
[1] ‘2.4.2’
But when I go to load it:
library(swirl)
I receive an error:
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘R6’
Error: package or namespace load failed for ‘swirl’
The error "There is no package called 'R6'" tells you that you need that package installed as well. Running install.packages("R6");library(R6) should take care of that.
The swirl package load the testthat package, which loads the R6 package. Since you don't have R6 installed, you can't load testthat, and you can't load swirl.

Loading ggplot2 package, missing 'munsell' package

I am trying to load ggplot2. I am using Windows 7. R tells me that ggplot2 has loaded successfully but when I try to use the library function it says it cannot find ggplot2. Here is what it says.
install.packages("ggplot2")
Installing package into ‘C:/Users/Owner/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/ggplot2_1.0.0.zip'
Content type 'application/zip' length 2675581 bytes (2.6 Mb)
opened URL
downloaded 2.6 Mb
package ‘ggplot2’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Owner\AppData\Local\Temp\RtmpyesS1j\downloaded_packages
I then tried to use the library function and got this message:
library("ggplot2")
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘munsell’
Error: package or namespace load failed for ‘ggplot2’
> head(diamonds)
Error in head(diamonds) : object 'diamonds' not found
I hope someone has an idea about what I have done wrong.
You should have executed this:
install.packages("ggplot2", dependencies=TRUE)

Resources