I have installed the sp and raster packages for R and there appears to be many other packages that could be applicable. The big problems with the correct functioning and installation of the R plugin was with the installation of matplotlib. Installing all the newest packages did not work so in some cases the previous versions had to be used. This is a trial and error experience. Also the question of 64bit vs 32bit on the mac (which runs 64bit OS X) is still unclear. I believe that QGIS runs in 32bit and therefore interfaces with 32bit R. And the matplotlib and other packages need to be 32bit. I'm not completely certain about this yet.
R needed the language to be set to english to remove the ASCII problem. I also had to install xcode for mac to get the gcc compiler working to install *.tar.gz packages.
For manageR to work the sp and rgdal packages are necessary. These can be installed using the GUI of R. under the packages menu>install packages. It's necessary to select install to local host and also install dependencies. For rgdal to function the gdal installation is required. When i tried to install rgdal throuhg the R GUI it could not find the gdal config file. I think it is a path issue but I could not resolve it. I downloaded the rgdal package from the kyngchaos website and followed the instructions in the readme. This seems to have worked.
I have had to learn a bit of python command prompt commands... most importantly, setting the directory of the folder containing the package:
- cd ~/downloads/
- open .bash_profile
- R CMD INSTALL packagename.tar.gz
- echo $PATH
- ls -a (to see all terminal related files)
It's case sensitive for commands.
Anyway, the manageR plugin seems to be working. Now how to use it!?
Doing raster analysis in R requires the "maptools" and "sp" packages.
The "maptools" installation requires various packages, amongst which is the "rgeos" package, which can be installed directly in the R interface. This install requires the GEOS framework which is available (with most of the solutions to my Mac OSX installation solutions) on the Kyngchaos website. I installed both the GEOS framework and the "rgeos" package that was available on the website. The GEOS framework is self installing but the "rgeos" package needs to be downloaded and then installed within the R interface selecting Packages & Data > Package Installer and then selecting Local Source Package, At User Level, Clicking Install and selecting the unzipped "rgeos" folder.