Whenever I try to install a package in R, I get the following error:
Error in readRDS(file) : unknown input format
This just started occurring after I had a system crash. I am running 32 bit R 2.13.0 under windows 7. I tried removing and re-installing R, but continue to get the error. Is there any way I can fix this without deleting everything (i.e. all the packages I've installed) and starting over?
Thanks
This happened to me after I had to reboot my machine in the middle of installing several R packages. I removed the latest installed packages by physically removing the files in the appropriate library directory, reinstalled them, and all was well. I also had to remove a
00LOCK
directory in the library directory.I checked for this issue on several forums and then I tried this and it worked for me:
1) Remove the ggplot2 package first
2) Install the package again
3) restart rstudio and install your package again, hope this helps
Seems that the issue was with the required package (ggplot2 in my case) got corrupt and was hampering the installation of any new dependent package.
These are suggestions I have come across:
.Rhistory
and.RData
files in the directory in which you are running R.update.packages()
Try and detect "bad files" in your library directories. You can do this in R
Delete any files/directories highlighted. You could use
file.remove()
if you really wanted to.Delete the directory in which you have stored your downloaded packages.
Only solution 3 worked for me.
Ref:
Something simple to try: if it is an .rda file use
load
instead ofreadRDS
. You can then save the loaded file as an .rds and tryreadRDS
again.Here is what I had to do to solve this error:
You might have some problem with R packages . See if the problem has occurred after you installed some packed or did you copied the packages.
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 . I has the same issue and it was due to package problem.