Radiant R not working on shiny server - r

As per given instruction on the website, I installed the Radiant package on Ubuntu server with the following command.
install.packages("radiant", repos = "https://radiant-rstats.github.io/minicran/")
Then cloned the repo from here and placed it in the /srv/shiny server/ folder of shiny server.
I can run radiant from addins and from within RStuodio, however as soon as I point my browser to ipaddress:3838/inst/app I get the following error in the browser.
An error has occurred
The application failed to start.
The application exited during initialization.
The shiny server log produces the following error:
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace ‘shiny’ 0.14.2 is already loaded, but >= 1.0 is required
Calls: runApp ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
I checked the shiny version, it is indeed the latest version, I'm not able to identify the problem, any help.

Like i mentioned in the comments, often it helps to install the package outside R (from command line). If you have the package locally available you can use R CMD INSTALL shiny_1.0.3.tar.gz. If you dont have it locally available you could download it with e.g wget from https://cran.r-project.org/src/contrib/shiny_1.0.3.tar.gz.

It´s been a while so I wonder if you fixed the issue in any case there are some new versions of the package that might help. I suggest the following:
Follow the most up to date version at http://vnijs.github.io/radiant/
Try installing directly in the R console without going inside Rstudio o Rstudio server.
Hope that helps!
Cheers!

Related

How to avoid Error in load Namespace using R

Am trying to launch a shiny app using the below command.
Rscript -e "shiny::runApp('test-app', launch.browser=TRUE)"
However, I get an error as shown below
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace 'htmltools' 0.4.0 is being loaded, but >= 0.4.0.9003 is required
Calls: :: ... getNamespace -> loadNamespace -> namespaceImport -> loadNamespace
Execution halted
I did check my library folder and see that htmltools package is present.
I also tried the below dependencies=TRUE
install.packages(pkgs,lib = "C:/Users/User/Desktop/data/library",repo = "https://cloud.r-project.org",dependencies=TRUE)
Here pkgs is a list containing list of packages that has to be installed.
The problem is same script works in my system but it doesn't work in my colleague's system. How can I resolve this?
Can help me understand what's the issue?
Although Kouadio has the correct answer, I found it difficult to follow those brief instructions, so I'm making them more detailed here.
Quit RStudio.
Find the RStudio launch icon, either on your desktop or in your Windows Start Menu.
Right-click the icon and choose "Run as administrator." Say yes when prompted that this is really what you want to do.
In RStudio, go to the Tools menu and choose Check for Updates.
Select all the packages and choose to update them. Say yes to the relevant prompts.
You should then be able to use the Knit button again, but you probably want to quit RStudio and restart in non-administrative mode before doing so.
I found new solution ,
you need to run rstudio with admin mode for check you update
After all packages are installed
Close Rstudio
Run Rstudio in normal mode .

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.

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 in using shinyserver

I have run shinyAPP in server, some APP doesn't work and error message show as picture, I don't know how to solve it.
It seems there is no dplyr package installed in the library used by the R process which your shiny server is using.
from browser console:
Listening on http://127.0.0.1:56037
Warning: Error in library: there is no package called ‘dplyr’
Stack trace (innermost first):
38: library
1: runApp
Error in library(dplyr) : there is no package called ‘dplyr’
Ensure that you have the package installed in the library folder used by shiny server.
E.g. in my case I have separate R used by RStudio so that development is separated from live app.
My library sits in usr//lib64//R//library therefore in linux i will run R as superuser sudo R and then install.packages("dplyr", lib="usr//lib64//R//library//")

Car package not found by R (failed to load)

I am am trying to load a simple dataset using:
library(car)
but I get the following error:
Error in library("car") : there is no package called 'car'
Does anyone have an idea why this happens and how to solve it?
If you don't currently use an IDE (or even if you do), the following will install the package:
install.packages("car")
Before then running
library("car")
You should heed #Iris's advice and use a RStudio if you don't already to manage just this sort of task.
You forgot to install the package before you tried to load it.
Do you use a IDE (integrated development environment)? I can strongly recommmand the use of Rstudio as IDE.
When you installed Rstudio, you can choose in the toolbar: "Tools" > "Install packages..."
Type in "car" and click "install".
As soon as the package is installed, you can load the package with library(car)
I know this post was from several months ago, but I came across it after having the same issue. I followed the instructions here (it's a .doc download).
I typically use R Studio, but was having no luck with this:
install.packages("car")
I opened the R application (not Studio) and followed the instructions on the .doc. I now have the package. Good luck!
For security purposes, I use R in a standard account on a Mac and download packages via a separate admin account. Yesterday I updated Microsoft R Open from 3.2.2 to 3.2.3 and I got this message when I tried to load Rcmdr:
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace ‘nlme’ 3.1-122 is being loaded, but >= 3.1.123 is required
Error: package ‘car’ could not be loaded
I had to log in to my admin account and check for updates. There was one for nlme, that I installed and that allowed car to load.
This worked for me. After downloading the most stable version of R (3.4.4), first, I install.packages("car",dependencies=TRUE) then install all the packages that when loading car I was asked for like haven, foreign, etc. So I installed them separately. Also, I noticed that when I install the packages they go to win-library folder instead of the actual working folder (the packages go to R\win-library\3.4 instead of R\R-3.4.4. So I copied them to the right folder.
I used Tools/Install packages... from R Studio and chose not to compile from source and do this for several packages it complains missing. And it works!

Resources