R version 3.4.1 error in install.packages(ggplot2) - r

I am having some trouble installing packages on R, and I'm not sure what to do. The errors are as follows:
The downloaded binary packages are in
C:\Users\XanDesktop\AppData\Local\Temp\Rtmpyy8lER\downloaded_packages
install.packages("ggplot2", repos="http://cran.rstudio.com/")
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/
Installing package into ‘C:/Users/XanDesktop/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘rlang’
There are binary versions available but the source versions are later:
binary source needs_compilation
rlang 0.3.4 0.4.11 TRUE
ggplot2 3.1.1 3.3.5 FALSE
Binaries will be installed
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.4/rlang_0.3.4.zip'
Content type 'application/zip' length 1080437 bytes (1.0 MB)
downloaded 1.0 MB
Error in install.packages : cannot open file 'C:/Users/XanDesktop/Documents/R/win-library/3.4/file4c04705ac2/rlang/help/figures/rlang.png': Permission denied
Any ideas? Thanks in advance!

Related

Installing Source Packages

I'm unable to install certain source packages in R. Until now I've just made do with using binary, however the in trying to use rmarkdown this workaround isn't possible (RMarkdown requires updated version to work).
I don't understand what this issue is. I've installed the correct version of RTools (3.5) for the R (3.6.3) that I'm using, but that alone hasn't fixed it.
Am using Windows 10.
Would really appreciate pointing in the right direction. The error message looks like this (for all packages that fail):
** Installing R Package Dependencies for R Markdown: 'rmarkdown', 'stringi'
[1/4] Installing bslib...
Installing package into 'C:/Users/paulb/OneDrive/Documents/R/win-library/3.6'
(as 'lib' is unspecified)
also installing the dependency 'htmltools'
There are binary versions available but the source versions are later:
binary source needs_compilation
htmltools 0.5.1.1 0.5.2 TRUE
bslib 0.2.4 0.3.1 FALSE
installing the source packages 'htmltools', 'bslib'
trying URL 'https://cran.rstudio.com/src/contrib/htmltools_0.5.2.tar.gz'
Content type 'application/x-gzip' length 124510 bytes (121 KB)
==================================================
downloaded 121 KB
trying URL 'https://cran.rstudio.com/src/contrib/bslib_0.3.1.tar.gz'
Content type 'application/x-gzip' length 4908277 bytes (4.7 MB)
==================================================
downloaded 4.7 MB
Error: object 'R' not found
Execution halted
First we have to install r version and RStudio then install recommend packages.
Use below youtube link in Hindi.
https://www.youtube.com/watch?v=dgmCiZvdI_4

Cannot install ggmap

I have been getting this every time I try to install ggmap:
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/
Installing package into ‘C:/Users/Julianne/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependency ‘rjson’ is not available
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/ggmap_3.0.0.zip'
Content type 'application/zip' length 4698501 bytes (4.5 MB)
downloaded 4.5 MB
package ‘ggmap’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Julianne\AppData\Local\Temp\RtmpUTtA97\downloaded_packages
I have installed Rtools but still cannot install ggmap or rjson.

I have a problem to install (psych) package

> install.packages("psych")
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/
Installing package into ‘C:/Users/Ali Basuony/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependency ‘mnormt’ is not available
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/psych_1.9.12.31.zip'
Content type 'application/zip' length 3800520 bytes (3.6 MB)
downloaded 3.6 MB
package ‘psych’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Ali Basuony\AppData\Local\Temp\RtmpeYduMH\downloaded_packages
> install.packages(‘mnormt’)
Error: unexpected input in "install.packages(‘"
> install.packages("mnormt")
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/
Installing package into ‘C:/Users/Ali Basuony/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘mnormt’ is not available (for R version 3.6.3)
The problem is described here:
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/
So you have two options:
Install RTools
You need Rtools to build packages from source on Windows. So visit this page:
https://cran.r-project.org/bin/windows/Rtools/history.html
and download appropriate version of Rtools to your R version (it seems to be Rtools35 as you probably have R 3.6.3). Note that it's about 1 GB on your hard drive.
Install binary packages
Or if you don't want to install Rtools, you maybe can try to install binary packages and not bother with building it from source. Then run this:
install.packages("psych", type = "binary", dependencies = TRUE)
install.packages("mnormt", type = "binary", dependencies = TRUE)
The current mnormt package depends on R version 4.0.0 or greater. You need to update R to install it, or install an older version. To install an older version you'll need Rtools.

Issue in installing devtools in R version 4.0

After updating the R version from 3.5 to 4.0 I am facing installation issues with devtools package.
Having Rtools 4.0 and RStudio-1.2.5042 downloaded and installed.
when I try to install devtools
install.packages("devtools")
I get this message:
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/ Installing package into
‘C:/Users/shalzsab/Documents/R/win-library/4.0’ (as ‘lib’ is
unspecified) also installing the dependency ‘usethis’
There is a binary version available but the source version is later:
binary source needs_compilation usethis 1.6.0 1.6.1 FALSE
trying URL
'https://cran.rstudio.com/bin/windows/contrib/4.0/devtools_2.3.0.zip'
Content type 'application/zip' length 351089 bytes (342 KB) downloaded
342 KB
package ‘devtools’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\shalzsab\AppData\Local\Temp\RtmpkhJwos\downloaded_packages
installing the source package ‘usethis’
trying URL 'https://cran.rstudio.com/src/contrib/usethis_1.6.1.tar.gz'
Content type 'application/x-gzip' length 255052 bytes (249 KB)
downloaded 249 KB
The downloaded source packages are in
‘C:\Users\shalzsab\AppData\Local\Temp\RtmpkhJwos\downloaded_packages’
And when I load the package I get this error
library(devtools)
Error: package ‘usethis’ required by ‘devtools’ could not be found
If I try to check the packages in the installation directory
find.package("devtools")
"C:/Users/shalzsab/Documents/R/win-library/4.0/devtools"
For usethis package I get this error
find.package("usethis")
Error in find.package("usethis") : there is no package called ‘usethis’
How can I solve this?

Error in installing *install.packages("tstools")* in language R

I am getting some error while installing package tstools.
Several other packages were installed correctly like(xts, forecast, MAPA, openxslx),
but this one causing trouble.
R version: 3.5.0
RStudio version: 1.1.447
CRAN: Indonesia
OS: windows 10
Here is the error log...
> install.packages("tstools")
Installing package into ‘C:/Users/pc_name/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependency ‘data.table’
There is a binary version available but the source version is later:
binary source needs_compilation
tstools 0.3.6 0.3.6.1 FALSE
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘data.table’
These will not be installed
installing the source package ‘tstools’
trying URL 'https://cran.rstudio.com/src/contrib/tstools_0.3.6.1.tar.gz'
Content type 'application/x-gzip' length 960748 bytes (938 KB)
downloaded 938 KB
ERROR: dependency 'data.table' is not available for package 'tstools'
* removing 'C:/Users/pc_name/Documents/R/win-library/3.5/tstools'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘tstools’ had non-zero exit status
The downloaded source packages are in ‘C:\Users\pc_name\AppData\Local\Temp\Rtmp6l4hr7\downloaded_packages’
Have you tried using devtools?
install.packages("devtools")
devtools::install_github("trnnick/TStools")
Sometimes bioconductor also does the trick
source("https://bioconductor.org/biocLite.R")
biocLite("tstools")
Have you tried install.packages("tstools", dependencies = T) ?

Resources