R Studio Crashed

I was using one package on R version 3.4.2, but suddenly my R Studio started showing error: "R code execution error". Then, I tried reinstalling the same version of R but now I am unable to use the same package because it's showing the following error:

Error in readRDS(pfile) : **
** cannot read workspace version 3 written by R 3.6.0; need R 3.5.0 or newer

Please suggest how to fix this problem.

image

Reinstall the package under your current R version.

I removed the package and reinstalled it but I am getting the same error.

Hi,

I found a similar post here:

Apart from reinstalling the package, people also suggest reinstalling dependencies and checking the paths.

Hope this helps,
PJ

I'm going to guess that the error in reading version 3 files is due to this change in R 3.6.0 (R: R News):

Serialization format version 3 becomes the default for serialization and saving of the workspace ( save() , serialize() , saveRDS() , compiler::cmpfile() ). Serialized data in format 3 cannot be read by versions of R prior to version 3.5.0. Serialization format version 2 is still supported and can be selected by version = 2 in the save/serialization functions. The default can be changed back for the whole R session by setting environment variables R_DEFAULT_SAVE_VERSION and R_DEFAULT_SERIALIZE_VERSION to 2 . For maximal back-compatibility, files ‘vignette.rds’ and ‘partial.rdb’ generated by R CMD build are in serialization format version 2, and resave by default produces files in serialization format version 2 (unless the original is already in format version 3).

I'm guessing your on a version of R older than 3.6.0, and are trying to read a serialised file written by 3.6.0 (e.g. a workspace). What version of R are you using?

I am using R version 3.4.2

In that case, you will not be able to read in workspaces made from R 3.6. See my answer, below, with links to relevant changes:

1 Like

Not solved yet. Don't know what to do. Tried several things:

  1. Uninstalled new version of R 3.6.1, then tried to install a package on R 3.4.2, getting the following error.

  2. Installed new version (R 3.6.1) after removing all old version, still not working and showing the following error:

Error: package or namespace load failed for ‘SWATHtoMRM’:
** package ‘SWATHtoMRM’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version**

PS: the package is different but the error is the same.

If you look at the links from the prior post two main things are true:

  1. You can't load a workspace that was saved from R 3.6.1 with R 3.4.2
  2. You need to reinstall all packages when you update to R >= 3.5

So, if you're using R 3.6.1 you can't use packages installed with R 3.4.2. In this case, you'd need to install SWATHtoMRM.

After updating R to 3.6.1 version, run this command

update.packages(repos='http://cran.rstudio.com/', ask=FALSE, checkBuilt=TRUE)

I ran the command, and I got following error:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.