Skip to content

Commit 6837996

Browse files
committed
Merge pull request #3103 from rldhont/bugfix_processing_rscript_output_table
[BUGFIX][Processing][Rscript] Write output Table
2 parents 1cddf8d + 3b7c0fc commit 6837996

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def getExportCommands(self):
281281
value = value + '.tif'
282282
commands.append('writeGDAL(' + out.name + ',"' + value
283283
+ '")')
284-
if isinstance(out, OutputVector):
284+
elif isinstance(out, OutputVector):
285285
value = out.value
286286
if not value.endswith('shp'):
287287
value = value + '.shp'
@@ -290,6 +290,10 @@ def getExportCommands(self):
290290
filename = filename[:-4]
291291
commands.append('writeOGR(' + out.name + ',"' + value + '","'
292292
+ filename + '", driver="ESRI Shapefile")')
293+
elif isinstance(out, OutputTable):
294+
value = out.value
295+
value = value.replace('\\', '/')
296+
commands.append('write.csv(' + out.name + ',"' + value + '"')
293297

294298
if self.showPlots:
295299
commands.append('dev.off()')

0 commit comments

Comments
 (0)