Skip to content
Permalink
Browse files

Try to install R package rgdal if unavailable.

git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@353 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
cpolymeris@gmail.com
cpolymeris@gmail.com committed Aug 19, 2012
1 parent 6629230 commit 13e6dcb3314372aa3dbfa433a1389e2ad661d9bd
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/sextante/r/RAlgorithm.py
@@ -227,6 +227,13 @@ def getExportCommands(self):

def getImportCommands(self):
commands = []
# if rgdal is not available, try to install it
# just use US mirror
commands.append('options("repos"="http://cran.us.r-project.org")')
rLibDir = "%s/rlibs" % SextanteUtils.userFolder()
if not os.path.isdir(rLibDir): os.mkdir(rLibDir)
commands.append(
'tryCatch(find.package("rgdal"), error=function(e) install.packages("rgdal", lib="%s"))' % rLibDir)
commands.append("library(\"rgdal\")");
for param in self.parameters:
if isinstance(param, ParameterRaster):

0 comments on commit 13e6dcb

Please sign in to comment.
You can’t perform that action at this time.