
Library(rgrass7) use_sp() osgeo4w.root<-"C:\\OSGEO4W64" Sys.setenv(OSGEO4W_ROOT=osgeo4w.root) # define GISBASE <-paste0(osgeo4w.root,"\\apps\\grass\\grass78") Sys.setenv(GISBASE=) Be aware that grass may have different folder path for different versions like "grass-6.4.3", "grass78" or even "GRASS GIS 7.8" (having dots in filenames/paths is just not a good idea). Also you need to check which version of grass is installed and which version of python is availabe in OSGEO4W, otherwise it may not work as intended. Otherwise you need to change the path in the following code. So your installation folder Grass is perhaps included in OSGEO4W64, but you better check if this is true. When using Windows i highly recomend using the OSGEO4W installation, because it provides you some other nice tools that may be needed. Other users at the support board also added some lines and i hope it this code can help maybe save you some time in the near future:įirst of all, you need to find your GrassGIS installation folder. Bivand provided a safe solution, that should be used initialy so you can work without a problem.


Unfortunatly the r-package used for this interactiuon between R and Grass can have some problems when using Windows as an Operating System.
#Coding in grass gis software#
As you all may know, Grass GIS is a great software for academic purposes and using it in an environment like R/RStudio is a very good idea, because you can share your code and other people can reproduce the tasks you did.
