can't install package in Rstudio [duplicate] - r

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.

Related

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

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

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

Installing packages in R [duplicate]

This question already has an answer here:
Installed package, but getting an error that function can't be found R [duplicate]
(1 answer)
Closed 8 years ago.
I installed swirl package in R studio console and I started learning R programming. After completing a chapter I closed R studio. I didn't save the workspace while quitting the R studio.
After a day I started R-Studio again and ran swirl() command in the console. The R-Studio gave this error - "Error: could not find function "swirl""
Do I need to install the package everytime in R studio? Doesnt it store in R ? Pls help.
you should first type the command library (swirl). That will load the library in the namespace and allow you to use its functions.

Error: package ‘dmGWAS’ was built before R 3.0.0: please re-install it [duplicate]

This question already has answers here:
How do I install an R package from the source tarball on windows?
(6 answers)
Closed 1 year ago.
I downloaded the Windows binary file dmGWAS_2.3.zip clickHere and try to install it by clicking Packages/install package from local zip file. After install, when I try to load 'dmGWAS' I got the error 'Error: package ‘dmGWAS’ was built before R 3.0.0: please re-install it'. I am using win 7 and R 3.1.0.
I searched similar questions but find no solution.
try:
> update.packages(checkBuilt = TRUE, ask = FALSE)
The authors release the newest version dmGWAS_3.0, which is compatible with dmGWAS_2.3. You can use the new version at http://bioinfo.mc.vanderbilt.edu/dmGWAS/

Resources