(edited by VStus on 2016-09-28 09:02)
Posting: # 16687
Hi to all!
This post is intended to provide step-by-step HOWTO on installation of more-or-less recent version of R (3.2.5, “Very, Very Secure Dishes”) and latest version of PowerTOST package on Android devices.
In fact, most of modern smartphones are packed with quite powerful processors. As example: Samsung Galaxy S4 is approximately 40000 times more powerful than IBM System/360 Model 75J used by NASA to calculate Apollo flights trajectories (compared by Bogo MIPS). Thank's to Moore's law.
Example: R & PowerTOST in X11 via vnc viewer
Before you try: open this post in your Android's device browser, copy-paste of commands into terminal may be more convenient than typing. Check 'keyboard shortcuts' in GNURoot for more easy navigation with cursor keys and 'home' & 'end' buttons.
#Installation of programs from PlayMarket#
Programs to be installed from PlayMarket:
1. GNURoot (don't be confused, rooting is not required)
2. VNC Viewer (any VNC viewer shold work well, in fact, it's posible to connect via VNC from other device in local network).
Launch GNURoot and create Linux environment. I've tried WheezeX, because I'm familiar with Debian/Ubuntu. X means that minimal graphical system is onboard, so graphs could be displayed.
1. Create rootfs: select WheezyX
2. Run rootfs: WheezyX (to be able to install R and other Linux packages, mark 'run as fake root').
Now we are inside Linux console (bash-style):
Wheezy is an old version of Debian, so the R is outdated (2.5).
1. Adding R-Cran mirror with latest R backported to Wheezy (German mirror is selected by chance):
#Dowloading and installing PowerTOST#
PowerTOST as well as most other packages should be installed from source, as only limited number of r-cran packages for R 3.2.5 have been compiled for Wheezy.
1. Download PowerTOST and mvnorm source from r-cran:
Successful download should look like this:
2. Install packages into R:
After this step, you should be able to run R with already installed packaged in console mode:
It should be sufficient to run sample size estimations in your pocket. I may be wrong, but it seems that graphical output in console mode is automatically redirected to PDF files.
# Connecting to Linux X11 terminal via VNC Viever
1. Create new connection in VNC Viewer:
Link to VNC server - localhost:1 (or other number - check Linux console on start-up)
2. Start VNC session.
I'm not sure that code executed on all possible cores of your ARM processor.
Command above was completed in around 3 minutes, thus the smartphone is still significantly slower than by notebook (Core i5), where it took less than minute.
Please let me know if this is interesting/helpful.
Small update: better console navigation is possible with Hacker's keyboard (PlayMarket), as it adds arrow keys and allows navigation of command history.
Disclaimer: use at your own risk!
Edit: Merged with a later post; you can edit your posts for 24 hours. [Helmut]
Posting: # 16689
Is it possible to the same but... in an iPhone?
Posting: # 16690
I'm not using iOS devices, however I've found GNURoot to be available as a package for iOS, but not in AppStore. Thus, possible only after jailbreak.
Posting: # 16694
I must say I'm very impressed !
And of course I feel flattered that some people have the opinion that they can't be without
We (Helmut, Ben and me), the authors of
Posting: # 16695
Thank you! I've actually met a guy who was going to change his smartphone from iOS to Android just to be able to run R on it. It was an interesting experiment indeed.
By the way, bear should also be doable on Android.
I would add that in graphical mode, your Android phone may eat battery quite fast, so don't use it on lithium explosions-prone devices like Note 7 :)
Posting: # 16696
» I've actually met a guy ...
That guy is so crazy that when he came home from Prague in the middle of the night but still managed to spent >2 hours searching online for a way to install R/Linux in iOS. What a maniac!
» ... who was going to change his smartphone from iOS to Android just to be able to run R on it.
Well, it's actually change from company's Blackberry, which is a shitty device, to Android. That guy's iPhone is still pretty new so probably won't be thrown out of the window just yet.
By the way, thanks a lot for the information.
All the best,
Posting: # 16698
It works perfectly!
Some naive notes:
1. No need to copy # symbol here and later:
(I didn't know that, so it didn't work initially)
2. In VNC viewer I need to push middle button to paste some text (not thru right-button menu)
3. Your phone has excellent performance, I need to think about new one (more than 5 minutes for your example using current phone)
4. Every time when I'm starting wheezex, I got a message:
localhost:1 is taken because of /tmp/.X1-lock
Remove this file if there is no X server localhost:1
Each run adds new localhost line (1, 2, 3...)
I'm removing it manually, but is it possible to solve this problem automatically?
(edited by VStus on 2016-10-05 08:16)
Posting: # 16699
» Dziękuję bardzo!
» I'm removing it manually, but is it possible to solve this problem automatically?
More digging is required to solve this issue. It occurs because vncserver and Xsession are not terminated correctly during termination of GNURoot (when clicking to close the GNURoot console window). I've removed these files manually as well.
(I'm missing some other place where lock/pid files should be deleted)
There is a possibility to stop vncserver automatically upon exit, but it requires a correct number of screen (working in certain circumstances but not optimal solution)
File should be named ~/.bashrc (correct filename found!) and contain something like this:
Limitation of this solution:
- if display number changes - server should be stopped manually and
It should be possible to avoid this bug by addition of automatic removal of messing pid files at startup of GNURoot (before new vncserver is started), but I have not found the startup script yet.