Need help fixing an R error with the free version [duplicate] - r

This question already has answers here:
The cause of "bad magic number" error when loading a workspace and how to avoid it?
(10 answers)
Closed 6 years ago.
Using R version 3.3.0 (Windows)
Error: bad restore file magic number (file may be corrupted) -- no
data loaded
In addition: Warning message: file ‘.RData’ has magic number 'q' Use
of save versions prior to 2 is deprecated
During startup - Warning message:
unable to restore saved data in .RData
I reinstall R but the error is still exist.
Please help to remove this error.

Seems like you (or RStudio) is trying to load() something that isn't a workspace.
Some explanations here

Related

can't install package in Rstudio [duplicate]

This question already has answers here:
readRDS(file) in R
(14 answers)
Closed 4 years ago.
I tried to install ggtern, Ternary and Rtools (the latter as a test) but it doesn't work and always give me this error message
Error in readRDS(file) : unknown input format
Error in readRDS(pfile) : unknown input format
Does anyone know how I can solve this?
Thanks
Which version of R you are using to install the package?
Possible solutions
Delete your .Rhistory and .RData files in the directory in which you are running R.
Run update.packages()
Try and detect "bad files" in your library directories. You can do this in R
Delete the directory in which you have stored your downloaded packages.

Warning in install.packages : cannot remove prior installation of package ‘data.table’ [duplicate]

This question already has answers here:
R package updates
(4 answers)
Closed 4 years ago.
I tried to install package data.table in R. This error showed up. Could anyone resolve this?
I assume you're on Windows. You may have data.table loaded into your session already; on Windows, dlls that are part of a package can't be unloaded until R shuts down. So restart R and then try running install.packages again.
Try running R with admin access (sudo in Linux, or for Windows, right click and choose "Run as Administrator"). I had the same problem when running R from PowerShell in Windows, and this fixed it.

Can I make R install packages automatically? [duplicate]

This question already has answers here:
Check if R package is installed then load library
(6 answers)
Closed 6 years ago.
When running a script with new libraries, I will automatically respond to the error message Error in library(x) : there is no package called ‘x’ with install.packages("x"). Is there a way to automate this process?
if(! require("x")) install.packages("x")
but see Check if R package is installed then load library for more robust solutions

cannot install plyr package in R [duplicate]

This question already has answers here:
How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning?
(18 answers)
Closed 8 years ago.
I tried installing the plyr package and I got the warning message saying it isn't available for R version 3.0.2. Is this true or is no? If not, why would I be getting this message? I tried using two different CRAN mirrors and both gave the same message.
The answer is that the package is available in R (just checked this on my machine).
The particular error message that you are getting is very misleading. It is R's `catch-all' condition for anything that it doesn't understand going wrong during installation. You will get this error if you mis-spelled anything (Plyr instead of plyr) or your network connection is not working, or you are behind a proxy or whatever.
I typically get this problem when I am behind a proxy or I have mis-spelled something. But it can be because of any other number of reasons. I will suggest you make sure you can access the internet from inside R first.
If nothing works, you can always download the package from CRAN using a browser. If you are on Windows, you want the .zip version and if you are on *nix you want the .tar.gz version. (.tgz for Macs?). Then you can install it like so:
setwd("/path/where/I/downloaded/the/compressed/file")
install.packages("plyr", repos=NULL)
See if that works.

Error while using cairo_pdf() on R [duplicate]

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Error while using cairo devices in R on ubuntu
I m getting error message while using cairo_pdf().
cairo_pdf("sample.pdf")
Warning messages:
1: In cairo_pdf("sample.pdf") :
unable to load shared object '/usr/local/lib64/R/library/grDevices/libs//cairo.so':
/usr/local/lib64/R/library/grDevices/libs//cairo.so: undefined symbol: png_set_longjmp_fn
2: In cairo_pdf("sample.pdf") : failed to load cairo DLL
OS : RHEL6
R : 2.15
How can fix this error?
Regards
You have installed the package from your distribution repo or build it from source? It seems to me that the package in the RHEL repository compiled without option --with-cairo. Try to build the package from source (tarball, ~23 MB).

Resources