Finally got the code to run on my iPad with the R Compiler App. But it took a lot of changes.
- Due to the 128K input file limit, I had to move to a daily rather than hourly download from Sense, plus I had to seriously reduce the file size even for Jan-April by removing 70% of my devices (only kept the top 12 or so)
- Had to give up on reading the data file in directly and do as the coder of this app recommends - read the data file into the In (stdin), then read.csv (in the code) from “stdin”. Typical R offers much more graceful access to data.
- And forget about debugging on the iPhone/iPad - one error and the compiler craps out giving a cryptic message, with no indication of which line of code caused it.
The combination of code and datafile below should work on iPad/iPhone if you can get everything into the right place on your device.
Here’s the output from my iPad…