Persistence when running update.packages in R - r

If I open up an R console and send the command
update.packages(repos = "https://cran.cnr.Berkeley.edu/",ask=FALSE,checkBuilt=TRUE)`
It starts updating a small collection of packages, a somewhat representative output might include
Warning: package 'mgcv' in library 'C:/Program Files/R/R-3.4.2/library' will not be updated
There is a binary version available but the source version is later:
binary source needs_compilation
rlang 0.1.2 0.1.4 TRUE
Binaries will be installed
trying URL 'https://cran.cnr.Berkeley.edu/bin/windows/contrib/3.4/rlang_0.1.2.zip'
Content type 'application/zip' length 466520 bytes (455 KB)
downloaded 455 KB
package 'rlang' successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\me\AppData\Local\Temp\RtmpYFaFCR\downloaded_packages
update.packages(repos = "https://cran.cnr.Berkeley.edu/",ask=FALSE,checkBuilt=TRUE)
Warning: package 'mgcv' in library 'C:/Program Files/R/R-3.4.2/library' will not be updated
There is a binary version available but the source version is later:
binary source needs_compilation
rlang 0.1.2 0.1.4 TRUE
Binaries will be installed
trying URL 'https://cran.cnr.Berkeley.edu/bin/windows/contrib/3.4/rlang_0.1.2.zip'
Content type 'application/zip' length 466520 bytes (455 KB)
downloaded 455 KB
package 'rlang' successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\me\AppData\Local\Temp\RtmpYFaFCR\downloaded_packages
Unfortunately, if I turn around and run this again, I get the same report. This strikes me as not quite right, as these packages (with the exception of the ones explicitly tagged as "Will not be updated") should have been updated. Why are they still out of date?
The example above is small because I'm starting from a relatively new install, but as the months go by, this list will get longer and longer and it bogs down my script.
Hopefully this will be easily reproducible.

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

Getting error while installing R packages?

It has been awhile since i updated my packages. This morning when i tried to used update.packages(ask = F), it download the packages and tried to run the update but has spit out a number of warnings. see some glimpses here
> update.packages(ask = FALSE)
There are binary versions available but the source versions are later:
binary source needs_compilation
backports 1.1.7 1.1.9 TRUE
maptools 1.0-1 1.0-2 TRUE
Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/backports_1.1.7.zip'
Content type 'application/zip' length 81641 bytes (79 KB)
downloaded 79 KB
package ‘backports’ successfully unpacked and MD5 sums checked
package ‘dplyr’ successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package ‘dplyr’
Warning: restored ‘dplyr’
Not sure what happened but when i am trying to load the package i am getting message such as the one attached as picture. Anyway forward please as it seems i have lost everything.

Issues installing "forecast" package in R

I am trying to install the forecast package in R via: install.packages('forecast'), nevertheless this is not working.
The result:
There is a binary version available but the source version is later:
binary source needs_compilation
forecast 8.2 8.3 TRUE
Do you want to install from sources the package which needs compilation?
Not sure what to answer here, 'yes' or 'no'. If I answer 'no', the result is:
trying URL 'https://cran.rstudio.com/bin/macosx/mavericks/contrib/3.3/forecast_8.2.tgz'
Content type 'application/x-gzip' length 2204227 bytes (2.1 MB)
==================================================
downloaded 2.1 MB
tar: Failed to set default locale
The downloaded binary packages are in
/var/folders/qn/syx5z5tj4s5075wwmrrd3hbr0000gn/T//RtmpTBDqVs/downloaded_packages
If I type 'yes' some additional items are installed and I receive one error note:
Warning in install.packages :
installation of package 'forecast' had non-zero exit status
Unfortunately I cannot proceed with the necessary functions that this package provides. Thanks for any suggestions.
I had the same problems, changing primary CRAN repository works for me
Tools > Global Options > Packages

R does not find "update.packages"

I am running R in version 3.4.1 under Windows 7 64-bit. When I give update.packages(ask=FALSE) the routine starts, identifies some packages to be updated, downloads packages, and then returns:
Error in update.packages(ask = FALSE) :
could not find function "update.packages"
Execution halted
I cannot find a reason for this problem. I just installed the newest version of R.
Complete output: I add the complete output. Maybe the problem is hidden in here, see e.g. the Warning messages. I shortened some paths (...). The problem seems to be with package knitr?
There are binary versions available but the source versions are later:
binary source needs_compilation
knitr 1.16 1.17 FALSE
rlang 0.1.1 0.1.2 TRUE
Binaries will be installed
trying URL 'https://cran.wu.ac.at/bin/windows/contrib/3.4/rlang_0.1.1.zip'
Content type 'application/zip' length 466606 bytes (455 KB)
downloaded 455 KB
package ‘rlang’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\...
installing the source package ‘knitr’
trying URL 'https://cran.wu.ac.at/src/contrib/knitr_1.17.tar.gz'
Content type 'application/x-gzip' length 769923 bytes (751 KB)
downloaded 751 KB
Error in update.packages(ask = FALSE) :
could not find function "update.packages"
Execution halted
The downloaded source packages are in
‘C:\Users\...’
Warning messages:
1: running command '"C:/PROGRA~1/R/R-34~1.1/bin/x64/R" CMD INSTALL -l "N:\RLibrary" C:\Users\...' had status 1
2: In install.packages(update[instlib == l, "Package"], l, repos = repos, :
installation of package ‘knitr’ had non-zero exit status

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

Resources