But building requires a lot of patching as the libc is bionic (reduced).
[edit] 2011 Aug 1: Fixed Rscript’s R_HOME (was /data/local/work/R lol)
Also fixed sysutils.c(libR.so) (and littler.c)’s hardcoded /tmp to /data/local/gcc/tmp. You need root to mkdir /tmp on Android.
[edit2] 2011 Aug 5: Fixed lib/R/library/*’s permission. Now non-root user can untar.
[edit3] 2011 Aug 6: Fixed R/Rcmd/...’s /sbin/bash dependency (now they use /system/bin/sh correctly).
You should update to r1a2.
get 3 files:
then (here I suppose you have GNU tar or busybox):
adb shell mkdir /data/local/gcc adb push android_gcc_r2a.tar.bz2 /data/local/gcc adb push android_gcc_supplement.tar.bz2 /data/local/gcc adb push android_R_r1a2.tar.bz2 /data/local/gcc adb shell cd /data/local/gcc tar xjf android_gcc_r2a.tar.bz2 tar xjf android_gcc_supplement.tar.bz2 tar xjf android_R_r1a2.tar.bz2
finally (writing to bashrc is recommended):
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/gcc/lib export PATH=$PATH:/data/local/gcc/bin
This consumes 170MB, so be careful if your Android’s /data is small.
If you still want to compile and install R by yourself check Build R section.
As only R binary is provided by this package, you have to install packages in R way via install.packages()
.
For non-basic packages, you can normally use install.packages()
as it is described elsewhere.
If your device isn’t rooted, you will have to “chmod -R o+rx /data/local/gcc/lib/R/library”.
Packages can be updated via R’s update.packages()
function.
TBA. There are too many patches around glob/wctrans/tre_regwcomp. I had to kill WCHAR support to make grep() work.
Perhaps you don’t have enough space to execute “make install”. So modify bin/R and etc/{ldpaths,Renviron} by hand.
Well, this configured R is compatible with http://dirk.eddelbuettel.com/code/littler.html .
Once installed, open up a console and type:
R
If you have VERY low /data capacity and 170MB is too much, there is a workaround if your Android is rooted.
Of course your kernel must have ext2(or ext3) support... Aww only if vfat had symlink stuff...