iPhone users who have jailbroken their phone have been able to compile
R for a while now since they have access to the command line via MobileTerminal. However, I just recently found out that a package is now up on Cydia to ease installation. So I fired up my iPhone 4 and installed
R on it just for fun using the instructions here.
I’ll write out the complete steps for installing
R onto the iPhone here as they are actually quite simple:
1. Have a jailbroken iPhone and the Cydia package manager app installed
(instructions not provided here).
2. Install OpenSSH and MobileTerminal via Cydia
Note that if you are running iOS 4, the current version of MobileTerminal on Cydia does not work properly, you’ll need to get an updated version from:
Copy the file to your iPhone via SFTP (or download it to your iPhone directly) and then install it via SSH using:
dpkg -i mobileterminal_364.3-12_iphoneos-arm.deb
3. Add a new repository to Cydia
In Cydia, go to Manage->Sources and Add the following repository:
4. Install R the Statistical Language
Use Search to find it, if you cannot, make sure your user level is either Hacker or Developer level under Manage->Settings because
R is a command-line program so it will not show up if you are at the User level. You can change your level back to User immediately afterwards.
R from command line
Load up MobileTerminal and run
R by simply typing:
- As it is based on command-line, plots are generated as files in the directory you start
Rin, as opposed to being displayed on screen.
- Packages need to be installed and updated with the
- I recommend portrait mode as the keyboard seems to take up less screen estate but that’s just personal preference.
- I’ve only tried this on iPhone 4′s retina display and it is barely usable so perhaps older iPhones would struggle with the readability.
- As of the time of writing this post, the packaged
R 2.10.1. If you need a newer version, you will have to wait for an updated package or compile from source.
Thanks to ech0chrome for the Cydia repository and the reference instructions.