Feature request #12806

Write output table in R scripts not supported

Added by matteo ghetta over 9 years ago. Updated over 7 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/Core
Pull Request or Patch supplied:No Resolution:duplicate
Easy fix?:No Copied to github as #:20902

Description

With an R script one can specify the ##name=output vector or ##name=output raster parameters.
It would be nice to have a table (as csv file) in the map canvas with the ##name=output table parameter too.


Related issues

Duplicates QGIS Application - Bug report #8919: R scripts: not possible to export .csv Closed 2013-10-20

History

#1 Updated by Alexander Bruy over 9 years ago

  • Status changed from Open to Rejected
  • Resolution set to invalid

OutputTable already available in R scripts with "##myoutput = output table"

#2 Updated by matteo ghetta over 9 years ago

Yes, you can specify table as output, but no csv (or other table file format) appear in the legend. With the following short script the tab file is not created:

##Point pattern analysis=group
##Layer=vector
##X=Field Layer
##tab= output table
M<-mean(LayerX)
SD<-sd(LayerX)
tab<-data.frame(M, SD)

But if you try

##Point pattern analysis=group
##Layer=vector
##X=Field Layer
M<-mean(LayerX)
SD<-sd(LayerX)
tab<-data.frame(M, SD)

tab

you can display the (correctly) result in the Result viewer.

#3 Updated by Filipe Dias over 9 years ago

Alexander, OutputTable is available but doesn't work.

This is a duplicate of #8919

There are plenty of ways of creating .csv or .txt from within the R environment. I believe I spoke with Victor Olaya about this in the past.

#4 Updated by Giovanni Manghi over 9 years ago

  • Status changed from Rejected to Closed
  • Resolution changed from invalid to duplicate

duplicate of #8919

#5 Updated by matteo ghetta over 9 years ago

Sorry, I don't think it is a duplicate issue. Anyway, I think that the piece of code is here:

https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/r/RAlgorithm.py#L264

as you can see, there are output defined if the output is set to raster and vector, but not for tables.

#6 Updated by Giovanni Manghi over 7 years ago

  • Easy fix? set to No

#7 Updated by Giovanni Manghi over 7 years ago

Some providers are being removed from QGIS/Processing (will be available as plugin) and so are their categories in the bug tracker. To not leave them orphaned of a category they are being reassigned to processing/core.

#8 Updated by Giovanni Manghi over 7 years ago

  • Category changed from 124 to Processing/Core

Also available in: Atom PDF