Bug report #8846

Running a R Script through Sextante not working

Added by Fabio Carocci about 11 years ago. Updated over 9 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/Core
Affected QGIS version:1.8.0 Regression?:No
Operating System:Windows XP Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:17529

Description

I am trying to run one of the example R scripts that comes with the default installation of QGIS 1.8. I have set-up the SEXTANTE options to point to the folder where R-3.0.2 is installed on my PC. After running the script (as an example the one to "Create Random sampling grid") the tool correctly build up the execution commands to be passed to R (see below) but nothing is generated and I receive a generic error message "Could not load layer: E:/XXX/test1.shp, Check the SEXTANTE log to look for errors". I have checked and the "rgdal" package is correctly installed in R and the commands are correctly executed in R. Glad for any advice you might give. Fabio

Algorithm Create random sampling grid starting...
R execution commands
options("repos"="http://cran.us.r-project.org")
tryCatch(find.package("rgdal"), error=function(e) install.packages("rgdal", lib="C:/Documents and Settings/<my name>/.qgis//sextante/rlibs"))
library("rgdal")
polyg = readOGR("E:/XXX",layer="Barrier")
numpoints=10
pts=spsample(polyg,numpoints,type="random")
output=SpatialPointsDataFrame(pts, as.data.frame(pts))
writeOGR(output,"E:/XXX/test1.shp","test1", driver="ESRI Shapefile")
R execution console output
Converting outputs
Loading resulting layers
Algorithm Create random sampling grid finished

History

#1 Updated by Filipe Dias about 11 years ago

  • Status changed from Open to Closed

You need to upgrade to QGIS 2.0 to be able to use R/Processing. The version you are using is outdated.

#2 Updated by Fabio Carocci about 11 years ago

I forgot to say that R Packages are currently installed in the folder specified in the "lib" variable. I am wondering if the problem is with the spaces in the "lib" variable

#3 Updated by Fabio Carocci about 11 years ago

Thanks. This is what I suspected but I wonder if anyone had the same problem when version 1.8 was still the latest version.

#4 Updated by Filipe Dias about 11 years ago

Yes, back then it had a lot of bugs. But now it's working ok.

#5 Updated by Jürgen Fischer about 11 years ago

  • Subject changed from Runung an R Script trough Sextante not working to Running a R Script through Sextante not working

#6 Updated by Giovanni Manghi over 9 years ago

  • Category changed from 94 to Processing/Core

Also available in: Atom PDF