ps and processx package update fail - r

I am trying to install a package ver. developer from github, which requires to update the ps and processx packages. RStudio is running in administrative mode in Windows 10 and the environment is empty. Moreover, both ps and processx packages are not loaded. But, I am still getting an error i.e. permission denied. I tried a solution mentioned here, but it doesn't work, how can this be fixed?
Warning messages:
1: In file.copy(savedcopy, lib, recursive = TRUE) :
problem copying C:\Users\ABC\OneDrive\Documents\R\win-library\4.0\00LOCK\ps\libs\x64\ps.dll to C:\Users\ABC\OneDrive\Documents\R\win-library\4.0\ps\libs\x64\ps.dll: Permission denied
2: In file.copy(savedcopy, lib, recursive = TRUE) :
problem copying C:\Users\ABC\OneDrive\Documents\R\win-library\4.0\00LOCK\processx\libs\x64\processx.dll to C:\Users\ABC\OneDrive\Documents\R\win-library\4.0\processx\libs\x64\processx.dll: Permission denied

Related

Issues installing CausalImpact in R

I am trying to install the Causal Impact package in R and get the following warnings/errors:
install.packages("CausalImpact")
--- Please select a CRAN mirror for use in this session ---
Warning: failed to download mirrors file (cannot open URL 'https://cran.r-project.org/CRAN_mirrors.csv'); using local file 'C:/Users/nlwes/AppData/Local/Programs/R/R-4.2.0/doc/CRAN_mirrors.csv'
Warning: unable to access index for repository https://mirror.dogado.de/cran/src/contrib:
cannot open URL 'https://mirror.dogado.de/cran/src/contrib/PACKAGES'
Warning: unable to access index for repository https://mirror.dogado.de/cran/bin/windows/contrib/4.2:
cannot open URL 'https://mirror.dogado.de/cran/bin/windows/contrib/4.2/PACKAGES'
Warning messages:
1: In download.file(url, destfile = f, quiet = TRUE) :
URL 'https://cran.r-project.org/CRAN_mirrors.csv': status was 'SSL peer certificate or SSH remote key was not OK'
2: package ‘CausalImpact’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
Anybody an idea how to fix the issue so I can install the package?

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.

Strange `tinytex` behavior - `~/.TinyTex` keeps dissapearing?

In my rocker/rstudio-derived docker container, I'm engulfed in a quagmire surrounding the yearly TexLive update and the R package tinytex.
I have gone through a plethora of iterations of tinytex::install_tinytex(), tinytex::uninstall_tinytex(), tinytex::reinstall(), etc.
I have installed the most current version via remotes::install_github("yiuhi/tinytex").
I have experimented with different (up to date) mirrors of CTAN.
When using a up to date mirror and having installed/reinstalled tinytex properly, I keep getting this behavior:
> tinytex::tinytex_root()
[1] "/home/rstudio/.TinyTeX"
> tinytex::pdflatex("<MYFILE>.tex")
tlmgr: package repository http://vesta.informatik.rwth-aachen.de/ftp/pub/mirror/ctan/systems/texlive/tlnet (verified)
[1/1, ??:??/??:??] install: koma-script [13745k]
running mktexlsr ...
done running mktexlsr.
tlmgr: package log updated: /home/rstudio/.TinyTeX/texmf-var/web2c/tlmgr.log
... 6 more successful package installs ...
tlmgr: package repository http://vesta.informatik.rwth-aachen.de/ftp/pub/mirror/ctan/systems/texlive/tlnet (verified)
[1/1, ??:??/??:??] install: babel-english [3k]
running mktexlsr ...
done running mktexlsr.
tlmgr: package log updated: /home/rstudio/.TinyTeX/texmf-var/web2c/tlmgr.log
! LaTeX Error: This NFSS system isn't set up properly.
! sh: 1: pdflatex: not found
Error: LaTeX failed to compile <MYFILE>.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See <MYFILE>.log for more info.
In addition: Warning messages:
1: In system2(..., stdout = if (use_file_stdout()) f1 else FALSE, stderr = f2) :
error in running command
2: In system2("tlmgr", args, ...) : error in running command
> tinytex::tinytex_root()
[1] ""
After this, ~/.TinyTeX (which was present before) is literally GONE from the file system!?
Can anybody shed light on why 1) tinytex appears to install, 2) it appears to properly process my *.tex file and pulling in the appropriate packages from CTAN and than 3) proceeds in one of those package installations to delete it's entire own installation!?
The observed behavior was a bug in the tinytex R package and has since been resolved (https://github.com/yihui/tinytex/issues/197).
Until the CRAN-available version is >= 0.21.5, one may remedy the behavior by installing directly from the author's repository by:
install.packages("remotes")
remotes::install_github("yihui/tinytex")

Can No Longer Load rgdal

I updated my GDAL to 2.2.2 on Ubuntu and now rgdal fails in R. I get this message when I try to load rgdal (I also tried to update rgdal, but didn't work).
Error in get(method, envir = home) :
lazy-load database '/home/R/x86_64-pc-linux-gnu-library/3.3/rgdal/R/rgdal.rdb' is corrupt
In addition: Warning messages:
1: In .registerS3method(fin[i, 1], fin[i, 2], fin[i, 3], fin[i, 4], :
restarting interrupted promise evaluation
2: In get(method, envir = home) :
restarting interrupted promise evaluation
3: In get(method, envir = home) : internal error -3 in R_decompress1
Error: package or namespace load failed for ‘rgdal’
Any ideas of how to fix this?
I was able to resolve this issue by deleting my corrupt rgdal installation, and simply reinstalling.
The warning message should indicate where it the folder is located (in your case /home/R/x86_64-pc-linux-gnu-library/3.3/rgdal)
In your terminal, you can delete the installed version with
rm -rf path/to/rgdal
where path/to/rgdal will be specific to your system and version. Then reinstall in R with install.packages('rgdal')
I resolve it by updating and upgrading my system :
sudo apt update & sudo apt upgrade
This worked for me:
remove.packages("rgdal")
install.packages("rgdal")
library(rgdal)
What worked for me
Open terminal
Run brew install gdal (this step may take a few minutes)
Note: After step 2, it may give an error if you already had it installed (that happened to me). If you get this error, run brew upgrade gdal (may take a few more minutes)
Reinstall rgdal from source, with:
install.packages("rgdal", repos = NULL, type="source")
Restart your R session (i.e. close and reopen RStudio) - you cannot skip this step
Now try library(rgdal) - it should succeed!
Other things to try
If the above steps don't work, try any of the following:
Download the rgdal package source and compiling manually by going to CRAN and downloading the source (click on the link outlined here), then install by running install.packages("path/to/downloaded/file/rgdal_1.5-23.tar.gz", repos = NULL, type="source")
Close and reopen RStudio and that may help
Also worth trying to manually delete the corrupted file (e.g. with rm /Users/$USER/Library/R/4.0/library/rgdal/R/rgdal.rdb), then running install.packages("rgdal", repos = NULL, type="source"), closing and reopening RStudio.
If all of that doesn't work, one last thing is to try install.packages("rgdal", repos="https://mac.R-project.org"), close and reopen RStudio, and hopefully library(rgdal) succeeds.
Hope some of these notes helps someone else with this problem!

Installing the package ZIGP from R archive

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.

Resources