R with GUI


I've been wrestling with a locale issue for the last few (10) days that was causing the data.entry() function to fail (catastrophically in Rcmdr). This has now finally been resolved. R.pnd will now include a total of 3 GUIs: Rcmdr: fully functional and well supported on the Pandora's screen; JGR/Deducer: works well, but I will need to return to it to optimise the default minimum screen size of JGR (currently about 100 pixels too big in the y-axis) and recompile the jar file and third, a really nasty looking basic Tk interface!

I won't be doing the jar recompile this time around - that'll be the release after this next one. I'll need to set up a proper java development environment on my PC but the source has already been modified so that "should' be a relatively straight forward task.

The java support has been well tested - it works very well indeed (though I say so myself). Just down to dotting i's and crossing t's, grabbing some screens doing some documentation and building in a font install script to run.sh and then I will upload the pnd. If you're interested, this should go up within the next week (I know, I said that before...)! I'm now in the position I expected to be a week ago - still, all's well that ends well.
 
R with GUI is now uploading to the repo.

 

First of all, you should understand that this is very much beta - more the Pandora stuff than the included software; I cannot test everything and there is a lot of new (to me) Pandora stuff in this pnd. All work (testing and compilation) has been carried out on a 1 Ghz OP - so I don't know what the performance will be like on a Rebirth or slower.

 

General Changes

I have re-compiled R as a shared library. This means in theory, adventurous souls could now mount the R.pnd and access R from "outside". I haven't tried this directly, but the theory is sound - ish. It obviously works to the extent that the GUI's are able to access R. Next, I have NOT stripped the binaries on this build - neither will I in future builds. Stripping R is a bit aggressive, and If I strip the binaries (as I did before), errors are not trapped at all; R just segfaults with no extra information - except for the option of a core dump. Leaving the binaries unstripped means errors are generally trapped uncatastrophically and with vaguely useful error messgaes. The package is bigger, but SD cards are cheap :p  . R.pnd now also installs a single, standard 9x15 X11 bitmap font that is needed by the data.entry() function into the appdatadir. An additional entry is also appended to the fontpath to make the new font available to R. The http daemon is now not disabled by defult since it can be useful in JGR. I have also rolled a copy of jgeiss's leafpad into this pnd and set it as the default code editor. If you want vi back, let me know - that's easy  :eek:

Java Support

Java support has now been included. To make use of Java in R, you MUST used Wizard Stan's Java runtime pnd (java.pnd V1.2.1.1) - nothing else has been tested. The Java.pnd file must also reside in the same physical location as R.pnd (ie, the same menu, app or desktop directory). A symlink should be honoured to an alternative location if you want to take this approach, although I have not tested this. When you start R, you will be asked whether you want java support for the session. If you intend to use an R  package that uses rJava, or has rJava or a java derivative as a dependency, click Yes on the dialogue. java.pnd will then be mounted, and made available to R. A couple of points here. java.pnd will not be exclusively available to R - if you run a java application in the middle of an R session, and exit the java application, java.pnd will be unmounted and R will loose java support. Also, on exit, R.pnd will only unmount java.pnd if it mounted it. So, a little care is required here. I haven't tried pulling out Java from undermeath R, so I have no idea how it will behave in this scenario but it is unlikely to be pretty.

 

Tcl/Tk

A full tcl/tk (8.6) environment is now also included. If you stay on the command line interface, you will still get the odd GUI element popping up (its called progress).

 

Additional Packages

The following additional packages have been installed on request: openNLP, openNLPmodels.en, gsubfn, languageR, zipfR, tm, shiny and the following RCmdr packages are also now pre-installed: RcmdrPlugin.BCA, RcmdrPlugin.coin, RcmdrPlugin.depthTools, RcmdrPlugin.doBy, RcmdrPlugin.DoE, RcmdrPlugin.EBM, RcmdrPlugin.EZR, RcmdrPlugin.KMggplot2, RcmdrPlugin.mosaic, RcmdrPlugin.MPAStats, RcmdrPlugin.plotByGroup, RcmdrPlugin.SCDA, RcmdrPlugin.SM, RcmdrPlugin.survival, RcmdrPlugin.TeachingDemos, RcmdrPlugin.temis.

 

I have also installed JGR and Deducer (and obviously their dependencies). R.pnd also contains the base and recommended packages. Installing further packages can be tricky from the pnd. You will only be able to install packages that contain pre-compiled code or R code, into a designated "library" that you have write access to. Sometimes, packages use of "make" even when they don't need compiling. These are likely (but are not guaranteed) to fail. If you need a package and can't get it to install, or need a package that needs pre-compilation (whether it is fortran or C) - shout and I'll do my best to roll it into the base pnd on the next maintenance release. It is almost impossible for me to test these packages, as they generally do stuff I have no adequate knowledge of. Any warnings or errors generated during package installs I have carried out are shown in package warnings.txt in the root of the pnd. WIth the additional, base and recommended packages, there are now a total of 139 packages insatlled: should be good for starters.

 

RCmdr

The RCmdr GUI is now included. Load it by issuing the command library(Rcmdr) at the R prompt. Job done. You can set Rcmdr as your default inerface in the usuual way in .Rprofile. I have lifted out the Rcmdr menu strucutre file (Rcmdr-menus.txt) and placed it into the appdata directory. In theory, this should allow some customisation of the Rcmdr interface and menu structure.

 

JGR

This is a Java based GUI. If you want to use it, make sure you answer the initial java support prompt by clicking on Yes. The y-axis of the main window is currently fixed too big for the OP screen. A future release will remedy this. The source code has already been modified, and I am slowly working on re-compiling it. However, although I have the JGR sources, it is necessary to rebuild the project tree - which isn't publicly available as a complete project. So, I have to poke around to find out which additional classes are required. I don't have a lot of time for OP stuff right now, so this will be a slowish project. Load the JGR GUI by using the command library(JGR) followed by JGR() at thr R command prompt. The JGR interface is actually quite well built and is very stable - if basic. Until I sort this issue, the JGR main window has to be moved around to gain access to the command area and the menu optoins simultaneously. Once I fix the y-axis window dimension, JGR will probably be the tool of choice for GUI interfaces until I build something more sophisticated. Again, JGR can be loaded by default via the standard .Rprofile file in the appdata directory.

 

Deducer

This can be run independetly from JGR, but works better with JGR.

 

Tk interface

The somewhat dated Tk interface (which shoudln't be confused with far more capable RCmdr), is loaded by adding the following to the first line of R.start (which should be in you appdata directory):

 

--gui=Tk

 


Known Issues

You will get a locale warning when exiting the data.entry() spreadsheet. I to not think this is significant - its just R being verbose, and warning you that it is operating in C locale mode.


 

Future Releases.

Well, fixing JGR once and for all. I would also like to go back and have another stab at RStudio - which should compile OK, but doesn't. Sorry, but no, RKward is out, out, out (only slightly biased there). Any feature requests - shout and I will see what I can do.

 

Any questions or problems, please post here in this thread and I'll do my best to assist.
 
Last edited by a moderator:
hi

cant seem to load openNLP and shiny via library() command


Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/mnt/utmp/R/lib/R/library/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directory
Error: package or namespace load failed for 'openNLP'


Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/mnt/utmp/R/lib/R/library/RJSONIO/libs/RJSONIO.so':
/usr/lib/libstdc++.so.6: version `CXXABI_ARM_1.3.3' not found (required by /mnt/utmp/R/lib/R/library/RJSONIO/libs/RJSONIO.so)
Error: package or namespace load failed for 'shiny'


thx
 
hi

cant seem to load openNLP and shiny via library() command


Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/mnt/utmp/R/lib/R/library/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directory
Error: package or namespace load failed for 'openNLP'


Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/mnt/utmp/R/lib/R/library/RJSONIO/libs/RJSONIO.so':
/usr/lib/libstdc++.so.6: version `CXXABI_ARM_1.3.3' not found (required by /mnt/utmp/R/lib/R/library/RJSONIO/libs/RJSONIO.so)
Error: package or namespace load failed for 'shiny'


thx
You have java.pnd mounted? You must click on the Yes button at the Java support prompt when starting R. Also, java.pnd MUST be in the same physical location as R.pnd.

<edit>

The second error is a bit more sinister. Basically, the R developers recommend that LD_LIBRARY_PATH not be set. R tries to be clever, and figure that sort of stuff out for itself. So, I took the export call out of the bin/R shell script file - looks like I need to put it back in. The problem is compounded by the fact that the libstdc++.so.6 in /usr/lib is different to the one I compile against. I'll do a re-test before uploading a re-rolled pnd later this evening.

</edit>

 

<2nd edit>

shiny package loads fine with a slightly modified pnd. Look for it later this evening. :)

</2nd edit>
 
Last edited by a moderator:
cheers,the other packages i requested load fine, java is started and is in same directory.

thanks for your efforts :)
 
cheers,the other packages i requested load fine, java is started and is in same directory.

thanks for your efforts :)
Just did a quick test on openNLP - it loads fine (if a little slowly). I've put an extra bit of logic in the java mounting construct to actually test whether the mount command was completed or not. Before, I just assumed the command was completed. Need to stop being so lazy :p  . You will now get a notification that the mount was completed (you don't have to click anything, the message dismisses itself).

I've started the (painfully slow) upload.
 
hi

grt openNLP  seems to load fine now but still problems with shiny

Code:
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/mnt/utmp/R/lib/R/library/httpuv/libs/httpuv.so':
  libRcpp.so: cannot open shared object file: No such file or directory
Error: package or namespace load failed for 'shiny
 
hi

grt openNLP  seems to load fine now but still problems with shiny


Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/mnt/utmp/R/lib/R/library/httpuv/libs/httpuv.so':
libRcpp.so: cannot open shared object file: No such file or directory
Error: package or namespace load failed for 'shiny
Odd - it loaded fine for me immediately prior to uploading 3.0.1.2. OK, I'll look into it.

Out of curiosity, what other packages are you loading prior to shiny? It just gives me a better chance of replicating your issue as closely as possible....
 
hi

grt openNLP  seems to load fine now but still problems with shiny


Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/mnt/utmp/R/lib/R/library/httpuv/libs/httpuv.so':
libRcpp.so: cannot open shared object file: No such file or directory
Error: package or namespace load failed for 'shiny

Okeeedoh!

This may well be a consequence of setting LD_LIBRAY_PATH externally to R. libRcpp.so is an R shared library - its actually in lib/R/library/Rcpp/lib - exactly where R put it during the install. At some point, I will have to do some Googling to find the reference to NOT setting LD_LIBRARY_PATH, and the consequences of actually setting it. Right now I believe, because LD_LIBRARY_PATH is set, R relies upon it totally to find all of the shared libraries - and doesn't do its own searching and path building. If this is the case, it could turn out to be a real headache.

Oddly, if I mount codeblocks, shiny loads - which leads me to believe my test yesterday evening still had codeblocks mounted - facepalm! However, what I cannot explain is what codeblocks is doing so that R finds libRcpp.so. Whilst codeblocks does set LD_LIBRAY_PATH, there is no reference to R in the paths. All very,very odd. 

I've done a quick and dirty fix by extending LD_LIBRARY_PATH to include lib/R/lib and lib/R/library that I'll test shortly - but I really will need to try and understand just what is going on and whether my initial thoughts are correct or not.

I'll try and upload yet another build later this evening (3.0.1.3) and post back here when it is available.
 
hi

grt openNLP  seems to load fine now but still problems with shiny


Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/mnt/utmp/R/lib/R/library/httpuv/libs/httpuv.so':
libRcpp.so: cannot open shared object file: No such file or directory
Error: package or namespace load failed for 'shiny

Okeeedoh!

This may well be a consequence of setting LD_LIBRAY_PATH externally to R. libRcpp.so is an R shared library - its actually in lib/R/library/Rcpp/lib - exactly where R put it during the install. At some point, I will have to do some Googling to find the reference to NOT setting LD_LIBRARY_PATH, and the consequences of actually setting it. Right now I believe, because LD_LIBRARY_PATH is set, R relies upon it totally to find all of the shared libraries - and doesn't do its own searching and path building. If this is the case, it could turn out to be a real headache.

Oddly, if I mount codeblocks, shiny loads - which leads me to believe my test yesterday evening still had codeblocks mounted - facepalm! However, what I cannot explain is what codeblocks is doing so that R finds libRcpp.so. Whilst codeblocks does set LD_LIBRAY_PATH, there is no reference to R in the paths. All very,very odd. 

I've done a quick and dirty fix by extending LD_LIBRARY_PATH to include lib/R/lib and lib/R/library that I'll test shortly - but I really will need to try and understand just what is going on and whether my initial thoughts are correct or not.

I'll try and upload yet another build later this evening (3.0.1.3) and post back here when it is available.

3.0.1.2 was re-uploaded with the LD_LIBRARY_PATH extended. Please give it a go and let me know how you get on.
 
hi thanks unfortunately new pnd is producing same error when trying to load shiny.
 
Arghhhh!

Can you do Sys.getenv("LD_LIBRARY_PATH") from the R prompt and post the results please?
hi

command produces this:

Code:
[1] "/mnt/utmp/R/lib/R/lib:/usr/local/lib:/mnt/utmp/R/lib:/mnt/utmp/java/jdk/jre/lib/arm/client:/mnut/utmp/R/lib:/mnt/utmp/lib/R/lib:/mnt/utmp/lib/R/library:/mnt/utmp/R/lib/R:/mnt/utmp/R/bin:/mnt/utmp/R/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games"
 
Arghhhh!

Can you do Sys.getenv("LD_LIBRARY_PATH") from the R prompt and post the results please?
hi

command produces this:


[1] "/mnt/utmp/R/lib/R/lib:/usr/local/lib:/mnt/utmp/R/lib:/mnt/utmp/java/jdk/jre/lib/arm/client:/mnut/utmp/R/lib:/mnt/utmp/lib/R/lib:/mnt/utmp/lib/R/library:/mnt/utmp/R/lib/R:/mnt/utmp/R/bin:/mnt/utmp/R/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games"

I spent some time between shifts today checking out exactly what was going on, and I now see the problem. It took about 15 tests, but in the end, LD_LIBRARY_PATH turned out to be a complete red herring. I'm very much relieved by that in many ways, as I could not understand what was going on. I have now removed all references to LD_LIBRARY_PATH, and there are now NO issues with loading your packages - providing java.pnd is mounted. And there lies the rub.

BTW, thanks for your patience. 

The problem is that I am mounting java.pnd, telling you I am mounting it after testing for the existence of /mnt/utmp/java/PXML.xml, and them with some flourish, promptly unmounting it. I cant believe I'm doing something so utterly stupid!!!! I am re-working the unmount portion of things right now and will hopefully get back to with something more than a temporary fix later this evening.
 
thats good news

hope not to wear yr patience but i still cant install packages, e.g trying to install corpora it d/l ok but then get this:


Warning in dir.create(lockdir, recursive = TRUE) :
cannot create dir '/mnt/utmp/R/lib/R/library/00LOCK-corpora', reason 'Operation not permitted'
ERROR: failed to create lock directory '/mnt/utmp/R/lib/R/library/00LOCK-corpora'

The downloaded source packages are in
'/var/volatile/tmp/RtmpXFZweL/downloaded_packages'
Updating HTML index of packages in '.Library'
Warning messages:
1: In install.packages("corpora") :
installation of package 'corpora' had non-zero exit status
2: In file.create(f.tg) :
cannot create file '/mnt/utmp/R/lib/R/doc/html/packages.html', reason 'Operation not permitted'
3: In make.packages.html(.Library) : cannot update HTML package index


thanks!
 
thats good news

hope not to wear yr patience but i still cant install packages, e.g trying to install corpora it d/l ok but then get this:


Warning in dir.create(lockdir, recursive = TRUE) :
cannot create dir '/mnt/utmp/R/lib/R/library/00LOCK-corpora', reason 'Operation not permitted'
ERROR: failed to create lock directory '/mnt/utmp/R/lib/R/library/00LOCK-corpora'

The downloaded source packages are in
'/var/volatile/tmp/RtmpXFZweL/downloaded_packages'
Updating HTML index of packages in '.Library'
Warning messages:
1: In install.packages("corpora") :
installation of package 'corpora' had non-zero exit status
2: In file.create(f.tg) :
cannot create file '/mnt/utmp/R/lib/R/doc/html/packages.html', reason 'Operation not permitted'
3: In make.packages.html(.Library) : cannot update HTML package index


thanks!
You need to create an another library in your appdata directory and tell R about it. You're currently trying to write to the pnd:

cannot create dir '/mnt/utmp/R/lib/R/library/00LOCK-corpora', reason 'Operation not permitted'
 
thats good news

hope not to wear yr patience but i still cant install packages, e.g trying to install corpora it d/l ok but then get this:


Warning in dir.create(lockdir, recursive = TRUE) :
cannot create dir '/mnt/utmp/R/lib/R/library/00LOCK-corpora', reason 'Operation not permitted'
ERROR: failed to create lock directory '/mnt/utmp/R/lib/R/library/00LOCK-corpora'

The downloaded source packages are in
'/var/volatile/tmp/RtmpXFZweL/downloaded_packages'
Updating HTML index of packages in '.Library'
Warning messages:
1: In install.packages("corpora") :
installation of package 'corpora' had non-zero exit status
2: In file.create(f.tg) :
cannot create file '/mnt/utmp/R/lib/R/doc/html/packages.html', reason 'Operation not permitted'
3: In make.packages.html(.Library) : cannot update HTML package index


thanks!
You need to create an another library in your appdata directory and tell R about it. You're currently trying to write to the pnd:

cannot create dir '/mnt/utmp/R/lib/R/library/00LOCK-corpora', reason 'Operation not permitted'
ah how do i do that?
 
thats good news

hope not to wear yr patience but i still cant install packages, e.g trying to install corpora it d/l ok but then get this:


Warning in dir.create(lockdir, recursive = TRUE) :
cannot create dir '/mnt/utmp/R/lib/R/library/00LOCK-corpora', reason 'Operation not permitted'
ERROR: failed to create lock directory '/mnt/utmp/R/lib/R/library/00LOCK-corpora'

The downloaded source packages are in
'/var/volatile/tmp/RtmpXFZweL/downloaded_packages'
Updating HTML index of packages in '.Library'
Warning messages:
1: In install.packages("corpora") :
installation of package 'corpora' had non-zero exit status
2: In file.create(f.tg) :
cannot create file '/mnt/utmp/R/lib/R/doc/html/packages.html', reason 'Operation not permitted'
3: In make.packages.html(.Library) : cannot update HTML package index


thanks!
You need to create an another library in your appdata directory and tell R about it. You're currently trying to write to the pnd:

cannot create dir '/mnt/utmp/R/lib/R/library/00LOCK-corpora', reason 'Operation not permitted'
ah how do i do that?
Section 6.2 deals with additional libraries, and 6.3 with installing packages to libraries.
 
I'm not using this myself in daily life, but I very much appreciate your efforts to bring "serious" software to the Pandora!
 
Back
Top