R - can't install package "rgl" - r

I've followed as many threads as I can on this to resolve, but no luck. Simply can't install R package "rgl". I have Upgraded Ubuntu server 16 to R version 3.3.1.
PuTTY X11 proxy: Unsupported authorisation protocol
Warning in rgl.init(initValue, onlyNULL) :
RGL: unable to open X11 display
Warning: 'rgl_init' failed, running with rgl.useNULL = TRUE
* DONE (rgl)
I've tried these bits of advice:
Error in installing rgl package
error: installation of package ‘rgl’ had non-zero exit status
I have X11 working fine outside R:
http://www.tomsitpro.com/articles/how-to-use-x11-forwarding,2-843.html
but still get the error above.
Thanks for any help,
S.

Ok, this seems to be solved. I was root, after exiting and using:
sudo R
install.packages("rgl")
everything was ok. so it seems you must install as sudo, not root, for everything to go in the right place.
Thanks,
S.

I checked it. Everything seems to work properly... Rscript - screen
But in "related" here I see some questions about error in installing rgl. Take a look e.g. Error in installing rgl package

Related

Cannot install tsDyn package in RStudio, 'mnormt' doesn't exist

I am trying to install the tsDyn package on my Macbook Pro running MacOSX Catalina version 10.15.2. in RStudio (v.1.3.959), running R (v.4.0.1). I get the following error:
ERROR: compilation failed for package ‘mnormt’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/mnormt’
Warning in install.packages :
installation of package ‘mnormt’ had non-zero exit status
I tried installing 'mnormt' myself, as well as deleted all irrelevant packages manually to get rid of any possible older versions that may be interfering with the 'tsDyn' package, but nothing seems to be working.
The 'tsDyn' package seems to be installing otherwise, but I cannot call the function 'VECM' because it R states that it does not exist.
Any help would be much appreciated.
If you are using Anaconda, inside Environments search for "r-mnormt" and install from there. Also you can try inside RStudio:
install.packages("r-mnormt")
It should work now.

Unable to install 'cli' package from GitHub repository using remotes::install_github()

I had recently posted a question about a unicode display issue linked here. The problem then was the 'cli' package bug in the version cli v2.0.0. This bug had been brought up and has been solved on the master branch on GitHub by the developer. I am trying to install the same using remotes::install_github("r-lib/cli"). RStudio connects to GitHub fine, downloads the package, begins installing it, goes onto the step for building the package and then returns an error. The error message is copied below:
Error: (converted from warning) Setting LC_CTYPE failed, using "C"
Execution halted
Error: Failed to install 'cli' from GitHub:
(converted from warning) installation of package '/var/folders/n0/__v02y5j02sby1w2_39185sh0000gn/T//Rtmp5HnvTL/file865408954cc/cli_2.0.0.9000.tar.gz' had non-zero exit status
Session information:
R version 3.6.1
macOS Catalina
Steps taken to solve the problem:
1.Have tried using the 'devtools' package to do the same; Same error message
2.Have reinstalled the Xcode developer tools on the system
3.Tried removing and reinstalling 'cli'. I can install from CRAN with the same bug in it; still cannot install from GitHub repo.
Any thoughts would be appreciated.
The same commands worked when I ran them in R console through terminal as superuser (sudo R from terminal). The packages compiled properly and installed.
Two pages which helped are linked below:
[Installing a package inside RStudio fails on macOS Catalina
[https://support.rstudio.com/hc/en-us/articles/200554786-Problem-Installing-Packages]

R: install uroot package in ubuntu

I am trying to install the forecast package which depends on uroot, which apparently have been written to require a GPU?
install.packages("uroot") yields the following error. Has anyone found this issue and may suggest a work around? I am using ubuntu 16.04.
I have the file in question located here: /usr/local/cuda-8.0/ and I added to my path export PATH=/usr/local/cuda-8.0/:$PATH
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/rstudio2/R/x86_64-pc-linux-gnu-library/3.2/uroot/libs/uroot.so':
libcudart.so.8.0: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/rstudio2/R/x86_64-pc-linux-gnu-library/3.2/uroot’
Warning in install.packages :
installation of package ‘uroot’ had non-zero exit status
Just in case this is useful for someone, I stumbled with the same problem trying to install "imputeTS" with R version 3.5.1 on Fedora 27 with CUDA 10.0 correctly installed an setted in PATH.
for me it just happened that I was running install.package("imputeTS") (which depends on forecast) in a R console as root, installing the packages to the user home solved the problem. It's seems that the libraries are searched in different places according to the user running the script, it's important to note that.
I just migrated to Linux. On an Ubuntu 18.04 setup, using install.packages with dependencies set to TRUE succeeded with no complaints. (No GPU on mu box.)
install.packages("forecast", dep=TRUE)
# there are quite a few dependencies and you happened to be missing one
packageDescription()
#-----------includes this line----------
Imports: colorspace, fracdiff, ggplot2 (>= 2.2.1), graphics, lmtest,
magrittr, nnet, parallel, Rcpp (>= 0.11.0), stats,
timeDate, tseries, urca, uroot, zoo
You can try to modify file "/etc/rstudio/rserver.conf", add "LD_LIBRARY_PATH" env, like:
rsession-ld-library-path=/usr/local/cuda/lib64
Actually, When you open session of "RStudio Server" from browser, the session does't get env from the ".bashrc".

Error when installing R package using Rstudio

I want to install http://cran.r-project.org/src/contrib/Archive/mecdf/ using RStudio but when I use
> install.packages('C:\\Users\\jandre\\Desktop\\mecdf_0.6.1.tar.gz', repos=NULL, type="source")
I get this error:
Installing package into ‘C:/Users/jandre/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Warning in install.packages :
running command '"C:/Program Files/R/R-3.1.1/bin/x64/R" CMD INSTALL -l "C:\Users\jandre\Documents\R\win-library\3.1" "C:/Users/jandre/Desktop/mecdf_0.6.1.tar.gz"' had status 1
Warning in install.packages :
installation of package ‘C:/Users/jandre/Desktop/mecdf_0.6.1.tar.gz’ had non-zero exit status
This occurs in every package I want to install using the tar.gz file. I'm on Win7 x64. RStudio Version 0.98.1028
Can't think of a way to fix this at the moment -- sorry -- but the R administration manual says explicitly:
Note that installing R into a directory whose path contains spaces is not supported, and at least some aspects (such as installing source packages) will not work.
I don't know why this doesn't bite people much more often, given that C:/Program Files/... seems like a relatively normal place to install things on Windows.
I would also expect that the double quotation marks around your R executable name ("C:/Program Files/R/R-3.1.1/bin/x64/R") in the system call should have protected you from this problem ... ?
I had the same error message with the installation of some packages(under Windows 10 OS with R and Rstudio).
It seems that the R software (not R Studio) is dealing with the library where package are installed.
I uninstalled R and Rstudio and installed it a path without space (ex: C:\Program\R).I tried to load the packages that previously failed and it seemed to fix the problem.

LOCAL R Package not running because of missing doMC dependancy

I am trying to get a local package to work but it depends on doMC which is only available for Mac and I don't have a Mac. Is there any way I can still make the package work? I use the following code:
install.packages("~/R/AMT/Code/CLVTools_1.0.5.tar.gz",repos=NULL,type="source")
After running the code I get the following error message:
Installing package into ‘C:/Users/alexa_000/Documents/R/win-library/3.0’
(as ‘lib’ is unspecified)ERROR: dependency 'doMC' is not available for package 'CLVTools'
* removing 'C:/Users/alexa_000/Documents/R/win-library/3.0/CLVTools'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-30~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\alexa_000\Documents\R\win-library\3.0" "C:/Users/alexa_000/Documents/R/AMT/Code/CLVTools_1.0.5.tar.gz"' had status 1
Warning in install.packages :
installation of package ‘C:/Users/alexa_000/Documents/R/AMT/Code/CLVTools_1.0.5.tar.gz’ had non-zero exit status
Does anyone have any ideas how to run the package anyways?
Any kind of help highly appreciated
Based on the documentation, that package should run on any Unix system, not just OS X.
Your best bet is to install a virtual machine and put a Linux distro on it, or dual-boot your Windows PC with Linux.
More generally, if you are going to be doing a lot of data processing with open source tools like R, Linux is your friend.

Resources