Installing R Packages Error in readRDS(file) : error reading from connection

error in readrds(pfile) cannot read workspace version 3
r load rdata error reading from connection
error in readrds(pfile) : cannot read workspace version 3 written by r 3.6.0; need r 3.5.0 or newer
error in load error reading from connection
error in readrds(pfile) : cannot read workspace version 3 written by r 3.6.1; need r 3.5.0 or newer
error in readrds(dest) unknown input format
error in readrds(pfile) : cannot read workspace version 3 written by r 3.6.2; need r 3.5.0 or newer
cannot read workspace version 3 written by r 4.0.0; need r 3.5.0 or newer

Whenever I try to install any package in R on Ubuntu 14.04, I'm getting the following error:

Error in readRDS(file) : error reading from connection

I already tried the methods given here but could not solve the problem.


1- Install the latest version of R form the CRAN and try to install a package.

2- If it is possible check it with another user account.

3- Try to install the R package locally.

4- If there is an RDS file created by the old version of R you may have another sort of problem, this is the warning from R help:

Warning

These functions have provided a stable interface since R 2.4.0 (when the storage of serialized objects was changed from character to raw vectors). However, the serialization format may change in future versions of R, so this interface should not be used for long-term storage of R objects.

On 32-bit platforms a raw vector is limited to 2^31 - 1 bytes, but R objects can exceed this and their serializations will normally be larger than the objects.

Ref: help(serialize)

Error in readRDS("<Rds file name here>") : error reading from , Error in readRDS("<Rds file name here>") : error reading from connection updated R to the latest version for MAC 1.1.453 package installation failed The error message error reading from connection is most commonly an issue with one's Tried installing rio to import RDS but same error :frowning:. 1- Install the latest version of R form the CRAN and try to install a package. 2- If it is possible check it with another user account. 3- Try to install the R package locally. 4- If there is an RDS file created by the old version of R you may have another sort of problem, this is the warning from R help: Warning


I was facing the same error and I restarted R session, it worked for me.

Error in readRDS(pfile) : error reading from connection, I installed RStudio 1.1.463 - Ubuntu 16.04+/Debian 9+ (64-bit) on Ubuntu 18.04.2​. Whenever I click the "Packages" tab, I get this message: Error in readRDS(pfile) : error reading from conn… Error in readRDS(pfile) : error reading from connection [1] "/home/fjcc/R/x86_64-pc-linux-gnu-library/3.5"  For ease of transition, I added some checks to see if an .httr-oauth file was already generated, following the instructions provided by the twitteR package. Depending on system cache options, this can create a problem .


If you have one or more incorrectly installed packages (e.g. because you had to force-reboot during installation) you need to re-install this/these package(s). You can find them using this code:

library(purrr)

.libPaths() %>%
set_names() %>%
map(function(lib) {
    .packages(all.available = TRUE, lib.loc = lib) %>%
    keep(function(pkg) {
        f <- system.file('Meta', 'package.rds', package = pkg, lib.loc = lib)
        tryCatch({readRDS(f); FALSE}, error = function(e) TRUE)
    })
})

This will return a nested list containing the broken packages:

$`/home/yourname/R`
[1] "brokenpkg"

$`/usr/lib64/R/library`
character(0)

$`/usr/share/R/library`
character(0)

You might need to delete the directories 00LOCK-<pkgname> that R created in the library location while trying to install the packages.

error in readRDS on R 3.4.0 · Issue #90 · trinker/pacman · GitHub, If I p_load or p_install a package not already installed, I end up with an error message about readRDS: Error in readRDS(dest) : error reading from connection​. Notes: R Project gives same issue, restarting R no resolution, starting over copying files from web in R project or just normal directory no luck either. googleBubble1 1410×755 132 KB EconomiCurtis July 20, 2018, 11:59am #6


I had this error on Windows 10 after installing R 3.4.0 from 3.3.1 (all 64-bit). It was resolved by manually installing an unrelated package from CRAN (I used ggplot2). No idea what the root cause was, but perhaps this will work for you as well.

Output from my code:

> library(pacman)
> p_load(plyr, XLConnect, ggplot2, stringr, magrittr, kirkegaard, lubridate, weights, psych, psychometric, polycor, effsize, readr)
Installing package into ‘C:/Users/Emil/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
Error in install.packages : error reading from connection
 Error in loadNamespace(name) : there is no package called ‘BiocInstaller’ 

Then I restarted R, and ran the same code:

> library(pacman)
> p_load(plyr, XLConnect, ggplot2, stringr, magrittr, kirkegaard, lubridate, weights, psych, psychometric, polycor, effsize, readr)
Installing package into ‘C:/Users/Emil/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
Error in readRDS(dest) : error reading from connection

I.e. same code, different error. Odd. Then I restarted R again and installed a random package, then reran my code and it worked.

> install.packages("ggplot2")
Warning in install.packages :
  cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/src/contrib/PACKAGES.rds': HTTP status was '404 Not Found'
Installing package into ‘C:/Users/Emil/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
  cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.4/PACKAGES.rds': HTTP status was '404 Not Found'
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/ggplot2_2.2.1.zip'
Content type 'application/zip' length 2782171 bytes (2.7 MB)
downloaded 2.7 MB

package ‘ggplot2’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\Emil\AppData\Local\Temp\RtmpCq4cFX\downloaded_packages
> library(pacman)
> p_load(plyr, XLConnect, ggplot2, stringr, magrittr, kirkegaard, lubridate, weights, psych, psychometric, polycor, effsize, readr)
Installing package into ‘C:/Users/Emil/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/effsize_0.7.1.zip'
Content type 'application/zip' length 36713 bytes (35 KB)
downloaded 35 KB

package ‘effsize’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\Emil\AppData\Local\Temp\RtmpCq4cFX\downloaded_packages

effsize installed

So, error seems to have had something to do with pacman trying to install effsize.

[R-sig-Debian] install.packages readRDS error, Previous message: [R-sig-Debian] install.packages readRDS error; Next Pais wrote: > Hi, > > I am running Ubuntu 10.10 and I have just installed R 2.14.0. "​Error in readRDS(file) : error reading from > the connection". Try to open the file in this way, avoiding any kind of possible problem related to the file path: tweets <- readRDS(file.choose()) An interactive window will be open and you will be able to select your file.


I also had the same problem. I followed the instructions given here http://www.ryantmoore.org/files/ht/htrtargz.pdf and installed all the required dependencies separately as and when they were required.

readRDS(pfile) : error reading from connection, I have a problem of installing and loading r packages. install.packages("​ggplot2") Error in readRDS(file) : error reading from connection  What you can do is Copy all the packages from Library and save it somewhere, then Copy some packages on the Library and restart the R test it and see how it works you have to try with all the packages one by one .


warning in rstudio, I have trouble in installing Bioconductor on CentOS6.4. R vers S4Vectors installation error. Hi, I am trying to install S4vectors package in R (on  Not entirely sure what the issue is, but I recently upgraded R to 3.4.0 and ever since pacman seems to be causing issues. If I p_load or p_install a package not already installed, I end up with an


Error in readRDS(file) : error reading from the connection, Error in readRDS(file) : error reading from the connection. I met this error when I was installing the package "stringr". It is one of the Right after the error, it prompts : "TRY removing /usr/local/lib/R/site-library/00LOCK-stringi/". They are widely used by R itself, for example to store metadata for a package and to store the help.search databases: the ".rds" file extension is most often used. Functions serialize and unserialize provide a slightly lower-level interface to serialization: objects serialized to a connection by serialize can be read back by readRDS and conversely.


Error message from install.packages() - wayward continuation line, Installing R Packages Error in readRDS(file) : error reading from connection. Whenever I try to install any package in R on Ubuntu 14.04, I'm getting the following  This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.