qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.56k stars 3k forks source link

Running a R Script through Sextante not working #17529

Closed qgib closed 5 years ago

qgib commented 11 years ago

Author Name: Fabio Carocci (Fabio Carocci) Original Redmine Issue: 8846 Affected QGIS version: 1.8.0 Redmine category:processing/core Assignee: Victor Olaya


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
qgib commented 11 years ago

Author Name: Filipe Dias (@fsdias)


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


qgib commented 11 years ago

Author Name: Fabio Carocci (Fabio Carocci)


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

qgib commented 11 years ago

Author Name: Fabio Carocci (Fabio Carocci)


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

qgib commented 11 years ago

Author Name: Filipe Dias (@fsdias)


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

qgib commented 11 years ago

Author Name: Jürgen Fischer (@jef-n)


qgib commented 9 years ago

Author Name: Giovanni Manghi (@gioman)