Skip to content

Commit f56c568

Browse files
committedMay 25, 2016
[BUGFIX][Processing][Rscript] Write output Table
Add support forwriting output table to Rscript command.
1 parent 2f49f6a commit f56c568

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎python/plugins/processing/algs/r/RAlgorithm.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def getExportCommands(self):
278278
value = value + '.tif'
279279
commands.append('writeGDAL(' + out.name + ',"' + value
280280
+ '")')
281-
if isinstance(out, OutputVector):
281+
elif isinstance(out, OutputVector):
282282
value = out.value
283283
if not value.endswith('shp'):
284284
value = value + '.shp'
@@ -287,6 +287,10 @@ def getExportCommands(self):
287287
filename = filename[:-4]
288288
commands.append('writeOGR(' + out.name + ',"' + value + '","'
289289
+ filename + '", driver="ESRI Shapefile")')
290+
elif isinstance(out, OutputTable):
291+
value = out.value
292+
value = value.replace('\\', '/')
293+
commands.append('write.csv(' + out.name + ',"' + value + '"')
290294

291295
if self.showPlots:
292296
commands.append('dev.off()')

0 commit comments

Comments
 (0)
Please sign in to comment.