Skip to content
Prev 14892 / 29559 Next

GRASS with R interface issues - running R within GRASS 6.4.2

On Mon, 23 Apr 2012, Laura S wrote:

            
Please do try to search more effectively. The standard way of running R 
inside GRASS on Windows is to start GRASS first in the location you are 
using, then enter the complete path to R at the MSYS prompt. The complete 
path is the same as the string shown as Target: under Properties if you 
right-click on the R icon on your Windows desktop. For example:

"C:/Program Files/R/R-2.15.0/bin/i386/Rgui.exe"

or the equivalent for your installation. You may also need to set the 
environment variable R_LIBS if R cannot "find" the correct library 
containing the packages you need.

If you are not using a GRASS location, you may use the initGRASS() 
function in spgrass6 to start a temporary GRASS session, often in a 
throw-away location, because you only need to move objects from R to 
GRASS, use GRASS on them, and move the output objects back to R. Then you 
need the complete path to the GRASS install directory, for example:

"C:/Program Files/GRASS 6.4.2"

or the equivalent for your installation.

It is also possible to use initGRASS() with existing locations in a 
scripting context, but this is not your case.

The grass-stats mailing list is often used for questions like this.

Hope this clarifies,

Roger