Installing the package ZIGP from R archive - r

I'm unable to install the ZIGP package in R (version 2.14.1). I've downloaded the file ZIGP_3.8.tar.gz from http://cran.r-project.org/src/contrib/Archive/ZIGP/ to the directory
"C:\Program Files\R\R-2.14.1\library". I've already tried several ways to install this package, but without success! For instance, I entered into the R program as an administrator (item "Run as administrator") and I've tried the command
install.packages("ZIGP", pkgs="C:/Program Files/R/R-2.14.1/library/ZIGP_3.8.tar.gz",repos=NULL), and the error message was:
Warning in install.packages("ZIGP", pkgs = "C:/Program Files/R/R-2.14.1/library/ZIGP_3.8.tar.gz", :
'lib = "ZIGP"' is not writable
Error in install.packages("ZIGP", pkgs = "C:/Program Files/R/R-2.14.1/library/ZIGP_3.8.tar.gz", :
unable to install packages
I've changed the security status in R properties, but the error remains the same.
Do anyone have any idea to solve this problem?
Thanks very much in advance.

Related

Can`t install datasets in R, not cvs and not xlsx

I am new to RStudio. And it was working well, about a week ago my computer update the new version of the system. And from this moment R doesnt work like before. I am trying to load at datasets in .xlsx and .cvs - it doesn`t work. R write like this:
** Installing R Package Dependencies for Excel Import: `'readxl', 'Rcpp'`
[1/5] Installing cellranger...
�������������� � utils::install.packages("cellranger", repos = "https://cran.rstudio.com/") :
'lib = "C:/Program Files/R/R-4.0.2/library"' is not writable
������ � utils::install.packages("cellranger", repos = "https://cran.rstudio.com/") :
unable to install packages
������: sourceWithProgress -> eval -> eval -> <Anonymous>
���������� �����������
I trying to install xlsx packages, it writes like this:
`install.packages("xlsx")`
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Warning in install.packages :
'lib = "C:/Program Files/R/R-4.0.2/library"' is not writable
Warning in install.packages :
не могу создать каталог 'C:\Users\Lina\OneDrive\?????????' по причине 'Invalid argument'
Error in install.packages : unable to create ‘C:/Users/Lina/OneDrive/?????????/R/win-library/4.0’
if somebody can help me?
Since you appear to be a Windows user, I can offer two pieces of advice.
First, make sure your R installation is in a location that you have write permissions to. In some Windows OS, the Program Files locations are by default locked down. If the computer is yours, you should be able to change the permissions to the R folder. How to do so will vary a little by your windows version, so I will not provide more instructions. One other thing you can try is to set R and RStudio to "Run as administrator".
Second, OneDrive is a bad place to put your R installation or your R packages. OneDrive does not support all filenames and file extensions. R and its packages will generate a number of unsupported files, and you will continually be notified that something will not sync and that you should do something about it.
On a Windows machine, I generally install R and set up the library at C:\R where I have appropriate permissions.

Unable to install any packages on R

I am trying to install packages for a spatial data course however each package I try install to R I get this same error message
Warning in install.packages :
'lib = "C:/Users/chris/OneDrive/Documents/R/win-library/3.4"' is not writable
I have made a folder under R in documents for 3.4.
I also get this error message;
cannot create dir 'C:\Users\chris\OneDrive\Documents\R\win-library\3.4\file2d1c49893057', reason 'No such file or directory'
Error in install.packages : unable to create temporary directory ‘C:\Users\chris\OneDrive\Documents\R\win-library\3.4\file2d1c49893057’
I don't understand whether I have to create a new directory before I install an R package or if I have a setting that prevents it from being able to install packages?
I have installed packages before/had R for 2 years and never had this issue....

Problem with installing RQDA package since it was archived 20/05/2020

I receive an error when installing RQDA on Windows 10.
I had run RQDA successfully, then a package wouldn't load and I deleted and tried to reinstall RQDA with these instructions: http://rqda.r-forge.r-project.org/.
Since then, I receive errors pointing towards RGtk2 and GTK+.
I tried loading RQDA both using the newest and older versions of R and RStudio. I tried on 3 different Windows computers.
Here is the link that shows the RQDA package was recently archived:
https://cran.r-project.org/web/packages/RQDA/index.html
The archive points towards requiring gWidgets, so I made sure the library of gWidgets loads successfully, which it does, as does library(gWidgetsRGtk2).
I also took care to install RTools4.0 for R 4.0.0 (https://cran.r-project.org/bin/windows/Rtools/).
I made sure GTK+ is on my PATH. (Path: %GTK_BASEPATH%\bin;) (GTK_PATH: C:\GTK).
I also tried loading RQDA and dependencies manually, but that's a never ending process.
Here is the error I receive:
Failed to load RGtk2 dynamic library, attempting to install it.
Please install GTK+ from http://ftp.gnome.org/pub/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip
If the package still does not load, please ensure that GTK+ is installed and that it is on your PATH environment variable
IN ANY CASE, RESTART R BEFORE TRYING TO LOAD THE PACKAGE AGAIN
Error in getOption("encoding") : Knotenstack-Überlauf
Zusätzlich: Warnmeldung:
Failed to load RGtk2 dynamic library, attempting to install it.
Please install GTK+ from http://ftp.gnome.org/pub/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip
If the package still does not load, please ensure that GTK+ is installed and that it is on your PATH environment variable
IN ANY CASE, RESTART R BEFORE TRYING TO LOAD THE PACKAGE AGAIN
Error: package or namespace load failed for 'RGtk2':
.onLoad in loadNamespace() für 'RGtk2' fehlgeschlagen, Details:
Aufruf: NULL
Fehler: Knotenstack-Überlauf
Fehler: Paket 'RGtk2' konnte nicht geladen werden
Zusätzlich: Warnmeldung:
Failed to load RGtk2 dynamic library, attempting to install it.
Ausführung angehalten
ERROR: lazy loading failed for package 'RQDA'
* removing 'C:/Users/haunschild/Documents/R/win-library/4.0/RQDA'
Warning in install.packages :
installation of package ‘RQDA_0.3-1.tar.gz’ had non-zero exit status
Trying to install RGtk2, I receive the following:
Error in inDL(x, as.logical(local), as.logical(now), ...) :
kann shared object 'C:/Users/haunschild/Documents/R/win-library/4.0/RGtk2/libs/x64/RGtk2.dll' nicht laden:
LoadLibrary failure: %1 ist keine zulässige Win32-Anwendung.
versuche URL 'http://ftp.gnome.org/pub/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip'
Content type 'application/zip' length 25830230 bytes (24.6 MB)
downloaded 24.6 MB
Learn more about GTK+ at http://www.gtk.org
If the package still does not load, please ensure that GTK+ is installed and that it is on your PATH environment variable
IN ANY CASE, RESTART R BEFORE TRYING TO LOAD THE PACKAGE AGAIN
Lade nötiges Paket: cairoDevice
Warnmeldungen:
1: Failed to load RGtk2 dynamic library, attempting to install it.
2: In dir.create(config_path, recursive = TRUE) :
'C:\Users\haunschild\Documents\R\win-library\4.0\RGtk2\gtk\x64\etc\gtk-2.0' existiert bereits
> detach("package:RGtk2", unload = TRUE)
Fehler: Paket ‘RGtk2’ wird von ‘gWidgetsRGtk2’ benötigt, wird deshalb nicht detached ("Is needed by gWidgetsRGTk2', is therefore not detached")
> library(RGtk2)
I also tried:
pkgFile <- "RQDA_0.3-1.tar.gz"
download.file(url = url, destfile = pkgFile)
# Install dependencies
install.packages(c("DBI","RSQLite","RGtk2","gWidgets","gWidgetsRGtk2"))
# Install package
install.packages(pkgs=pkgFile, type="source", repos=NULL)
# Delete package tarball
unlink(pkgFile)
An received the same RGTk2 error loop.
Any help would be greatly appreciated! Thanks!
I've got RQDA working in Windows after:
install.packages(c("gWidgets", "RGtk2", "igraph","plogr","bit","RSQLite"),depen=T)
To install "gWidgetsRGtk2" it was needed:
Download GTK+: http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.22/gtk+-bundle_2.22.1-20101227_win32.zip
Create an empty folder like c:\opt\
Unzip the content of that file in the folder created. You'll have something like c:\opt\gtk+-bundle_2.22.1-20101227_win32. The name of this folder can be changed.
Then add c:\opt\gtk+-bundle_2.22.1-20101227_win32\bin to your PATH
To add the bin folder to the PATH: right-click on "My Computer" and select "Properties", then "Advanced" tab, then "Environment Variables". Select the "PATH" variable and then "Edit" Add "c:\opt\gtk+-bundle_2.22.1-20101227_win32\bin" to the items in the PATH variable.
PS. Make sure you have no other versions of GTK+ in PATH.
So You can run the following code:
url <- "https://cran.r-project.org/src/contrib/Archive/gWidgetsRGtk2/gWidgetsRGtk2_0.0-86.tar.gz"
pkgFile <- "gWidgetsRGtk2_0.0-86.tar.gz"
download.file(url = url, destfile = pkgFile)
install.packages(pkgs=pkgFile, type="source", repos=NULL)
Once the "gWidgetsRGtk2" is installed, you can run the following command to install RQDA:
install.packages("RQDA",repos="http://R-Forge.R-project.org", type="source")
REFERENCES
https://rqda.r-forge.r-project.org/
https://github.com/krlmlr/r-appveyor/issues/48
We've been discussing this issue at : https://github.com/Ronggui/RQDA/issues/38
Some have reported success installing it and have given feedback on how to do it.
Some contributors are working to port RQDA to gWidgets2. May be one of their solutions works for you.
Good luck.
After I gave the answer above I tryed to install it my self and this was as far as I've got using RKWard 0.7.1b, on VM with MsWins10.
https://rkward.kde.org/
with R 3.6.3 in RKWard library (I had RQDA working before. So I uninstalled RKWard and deleted the library directory on C:\Program Files):
https://cran.r-project.org/bin/windows/base/old/3.6.3
and RTools35
https://cran.r-project.org/bin/windows/Rtools/history.html
also installed.
install.packages(c("gWidgets", "gWidgetsRGtk2", "RGtk2", "igraph","plogr","bit","RSQLite"),depen=T)
update.packages(ask = FALSE, checkBuilt = TRUE)
library(RGtk2)
Selected GTK+
Restarted RKWard
Installing ""RQDA_0.3-1.tar.gz", type = "source"", gave me an error: "Failed to load RGtk2 dynamic library, attempting to install it". But by chance, I just saw the post by #JanMarvin and it worked!!!
install.packages("https://cran.r-project.org/src/contrib/Archive/RQDA/RQDA_0.3-1.tar.gz", type = "source", INSTALL_opts = "--no-multiarch")
Then I ran:
update.packages(ask = FALSE, checkBuilt = TRUE)
And then
library (RQDA)
And it worked!!
If anyone could please refine it or give other suggestions as how to install it on MsWin, would be very much appreciated!
Thanks to #sjewo and #JanMarvin for their hard work!! porting this package to R 4.
These steps update the previous to install RQDA. I'm using Windows 10, and this code was run on April-17, 2021:
Use R version 3.6.3, 32 bits. If possible, also install Rstudio;
Run install.packages("gWidgets", repos="http://R-Forge.R-project.org");
Run install.packages(c("RGtk2","igraph","plogr","bit","RSQLite","cairoDevice"),depen=T);
Run library("RGtk2") . An error message will appear, asking you to install GTK+. Select it and press OK;
Restart R. Then run library("RGtk2") again to see if everything is OK;
Create the folder C:\GTK;
Go to https://download.gnome.org/binaries/win32/gtk+/2.22/ and download the file gtk+-bundle_2.22.1-20101227_win32.zip in C:\GTK;
Unpack the downloaded file in C:\GTK;
Go to the System environment and add to system variables C:\GTK\bin to your PATH;
Restart Windows;
Run the following code:
url <- "https://cran.r-project.org/src/contrib/Archive/gWidgetsRGtk2/gWidgetsRGtk2_0.0-86.1.tar.gz"
pkgFile <- "gWidgetsRGtk2_0.0-86.1.tar.gz"
download.file(url = url, destfile = pkgFile)
install.packages(pkgs=pkgFile, type="source", repos=NULL);
Finally, run install.packages("RQDA",repos="http://R-Forge.R-project.org", type="source");
Enjoy!!!
FWIW, I've written a package called RQDAassist that I and my team use to help with RQDA, including installing the CRAN archive on R 4.0. Check it out and if there's any problem, do post an issue. To do the step-wise installation of RQDA
RQDAassist::install()
That's it.
Also, I noticed that active development is ongoing by RQDA maintainers, so I expect (hope) this issue to be resolved soon.

Installing package in R Console in IBM Bluemix

I am not able to install packages in R console in dashDB from IBM Bluemix. I am executing the below line:
install.packages('tm')
I am getting this error:
Installing package into ‘/usr/lib64/R/library’ (as ‘lib’ is unspecified)
Warning in install.packages("tm") :
'lib = "/usr/lib64/R/library"' is not writable
Error in install.packages("tm") : unable to install packages
Execution halted
mv: cannot stat `/mnt/blumeta0/home/<userID>//<...>/<...>/output/*': No such file or directory
I have also tried giving the library parameters like this:
install.packages('tm', lib='/mnt/blumeta0/home/<userID>/R/x86_64-redhat-linux-gnu-library/3.2/lib')
I get this error:
Warning in install.packages("tm", lib = "/mnt/blumeta0/home/<userID>/R/x86_64-redhat-linux-gnu-library/3.2/lib/"):
'lib = "/mnt/blumeta0/home/<userID>/R/x86_64-redhat-linux-gnu-library/3.2/lib/"' is not writable.
Execution halted
mv: cannot stat `/mnt/blumeta0/home/dash107933//.3hwv1S2IEeq813rI935Gurz/1467874427867/output/*': No such file or directory
What could be the issue here? Do I have to do any other configuration changes before I try to install the packages? I have also tried to use .libPaths() function to set the library to above mentioned path.
The packages are getting installed properly in RStudio interface though.
Could you please help? Thanks!
PS: The keyinfo and UserIDs are removed in above statements.
I have installed packages using the 'Install Packages' menu item from the Tools Menu. Did you try that ?
See this picture for the menu location. Bluemix R Studio Web Interface

Unable to install ggplot2

I'm having trouble installing ggplot2 into R. I've looked around here and haven't seen the same error that I'm getting.
> install.packages('ggplot2', dep=TRUE)
Warning in install.packages("ggplot2", dep = TRUE) :
'lib = "C:/Program Files/R/R-2.13.1/library"' is not writable
Error in install.packages("ggplot2", dep = TRUE) :
unable to install packages
Can anybody help?
It would actually suffice to invoke as follows:
> install.packages('ggplot2', dep=TRUE, lib=NULL)
and R should substitue lib with the default location, as in my comment.
Or you could change the environment variable itself.
R needs to have write access to your library to install a package there. The other advice you're getting is good and should be preferred, but you can run R (or RStudio) as an administrator (right-click on the .exe and "Run as Administrator" is an option) which should give it write access to your library.
In RStudio:
Try going to "Tools";
At the top you have "Install packages", click on that;
Then click on "Install to Library", change that to another library and save there.

Resources