Link between Qt GUI and R

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Link between Qt GUI and R

typhoong
hi,

i want to build a Qt front-end GUI which communicates with R, and i am not sure what i should use for the interface. There seems to be many ways: R.dll, Rinside, Rcpp, RQt, Rtools... . what is the best way? please advice.

basically what i want to do is that, the Qt GUI will allow users to make selection and enter numbers, these inputs will be fed to R, already written .R files will perform the calculations, the calculation results (graphs/numbers) to be fed back and display in the GUI.

graham

Reply | Threaded
Open this post in threaded view
|

Re: Link between Qt GUI and R

Simon Urbanek

On Sep 11, 2011, at 6:30 AM, typhoong wrote:

> hi,
>
> i want to build a Qt front-end GUI which communicates with R, and i am not
> sure what i should use for the interface. There seems to be many ways:
> R.dll, Rinside, Rcpp, RQt, Rtools... . what is the best way? please advice.
>

I think qtgui already provides that ... but I didnt' test it myself ...

Cheers,
Simon


> basically what i want to do is that, the Qt GUI will allow users to make
> selection and enter numbers, these inputs will be fed to R, already written
> .R files will perform the calculations, the calculation results
> (graphs/numbers) to be fed back and display in the GUI.
>
> graham
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Link-between-Qt-GUI-and-R-tp3804976p3804976.html
> Sent from the R devel mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Link between Qt GUI and R

Dirk Eddelbuettel
In reply to this post by typhoong

On 11 September 2011 at 03:30, typhoong wrote:
| hi,
|
| i want to build a Qt front-end GUI which communicates with R, and i am not
| sure what i should use for the interface. There seems to be many ways:
| R.dll, Rinside, Rcpp, RQt, Rtools... . what is the best way? please advice.
|
| basically what i want to do is that, the Qt GUI will allow users to make
| selection and enter numbers, these inputs will be fed to R, already written
| .R files will perform the calculations, the calculation results
| (graphs/numbers) to be fed back and display in the GUI.

There is a complete (and working :) example in the RInside package. The
design used in that application is to have a main C++ program (written with
Qt) with happens to 'have R inside' --- which Rcpp and RInside facilitate.

RInside is on CRAN as well as on my site at

   http://dirk.eddelbuettel.com/code/rinside.html

and I blogged about this example at

   http://dirk.eddelbuettel.com/blog/2011/03/25#rinside_and_qt

As Simom mentioned, you can go the other way with keeping R as the core part
and extending via R via the qtbase / qtgui / ... project inside the GGobi
sources on github:

   https://github.com/ggobi

Dirk

--
Two new Rcpp master classes for R and C++ integration scheduled for
New York (Sep 24) and San Francisco (Oct 8), more details are at
http://dirk.eddelbuettel.com/blog/2011/08/04#rcpp_classes_2011-09_and_2011-10
http://www.revolutionanalytics.com/products/training/public/rcpp-master-class.php

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Link between Qt GUI and R

barry rowlingson
In reply to this post by typhoong
On Sun, Sep 11, 2011 at 11:30 AM, typhoong <[hidden email]> wrote:
> hi,
>
> i want to build a Qt front-end GUI which communicates with R, and i am not
> sure what i should use for the interface. There seems to be many ways:
> R.dll, Rinside, Rcpp, RQt, Rtools... . what is the best way? please advice.
>

Another way is to write the Qt GUI code in Python using the PyQt4
classes, then use RPy to call the required R functionality, get the
results back, slap them into the GUI.

If you can program in Python or want to learn it then its the best way by far :)

Barry

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Link between Qt GUI and R

typhoong
hi everyone, thanks for all the tips.


Barry, can you tell me why you think PyQT is by far the best way?

graham
Reply | Threaded
Open this post in threaded view
|

Re: Link between Qt GUI and R

barry rowlingson
On Mon, Sep 12, 2011 at 2:00 AM, typhoong <[hidden email]> wrote:
> hi everyone, thanks for all the tips.
>
>
> Barry, can you tell me why you think PyQT is by far the best way?

 I said that conditional on you knowing or wanting to learn Python.
Python interacts with Qt in much the same way as C++ interacts with
it, but without the annoying compile and link steps of C++ (Python is
an interpreted language). Qt was designed to work with C++, and so
development with Python and C++ should be faster than most other Qt
interfaces.

So if you already know Python, and your R scripts are already in the
can ready to go, there's less point learning, or even constructing,
some R-Qt interface than using the well-established and robust
Python-Qt interface.

Barry

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Link between Qt GUI and R

typhoong
hi Barry thanks for your explanation.

actually i don't know much about python, also i know nothing about C++, but i am willing to learn.

i had a look at the Rpy documentation, it looks quite good. I can see you can use R functions within Python. However, i don't really want to do that unless it is necessary, because all my codes necessary for calculation are already written in R !

I am not sure but I guess it is possible to get the numerical inputs from the GUI, initiate the already written R codes (dot R files) to calculate and produce the graphs/number, feed it back to Python/PyQt, and finally display in the GUI. Is that possible?

graham
Reply | Threaded
Open this post in threaded view
|

Re: Link between Qt GUI and R

jverzaniNWBKZ
In reply to this post by barry rowlingson
Barry Rowlingson <b.rowlingson <at> lancaster.ac.uk> writes:

>
> On Mon, Sep 12, 2011 at 2:00 AM, typhoong <graham.li <at>
> eurus-energy.com> wrote:
> > hi everyone, thanks for all the tips.
> >
> >
> > Barry, can you tell me why you think PyQT is by far the best way?
>
>  I said that conditional on you knowing or wanting to learn Python.
> Python interacts with Qt in much the same way as C++ interacts with
> it, but without the annoying compile and link steps of C++ (Python is
> an interpreted language). Qt was designed to work with C++, and so
> development with Python and C++ should be faster than most other Qt
> interfaces.
>
> So if you already know Python, and your R scripts are already in the
> can ready to go, there's less point learning, or even constructing,
> some R-Qt interface than using the well-established and robust
> Python-Qt interface.
>
> Barry
>
>


If you don't know python, there is no need to construct an R-Qt interface, there
already is one. Take a look at: https://github.com/ggobi/ for the package
qtbase and friends. There is some great work there.  (Simon referenced this
 earlier in this thread) For a simpler interface, there is also the gWidgetsQt
package on r-forge (https://r-forge.r-project.org/R/?group_id=761).

--John

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Link between Qt GUI and R

Michael Lawrence-3
In reply to this post by typhoong
There are two approaches that I would recommend, depending on your
requirements:

1) Write a Qt GUI application and embed R inside of it. Dirk has laid out
that solution.

2) Write the Qt GUI in R. Simon kindly mentioned qtgui but that is an
obsolete package. You would do this using qtbase, which is currently
available through Bioconductor. See:
http://www.bioconductor.org/packages/devel/bioc/html/qtbase.html. There is a
binary for Mac OS X but not Windows yet, unfortunately.

Michael

On Sun, Sep 11, 2011 at 3:30 AM, typhoong <[hidden email]>wrote:

> hi,
>
> i want to build a Qt front-end GUI which communicates with R, and i am not
> sure what i should use for the interface. There seems to be many ways:
> R.dll, Rinside, Rcpp, RQt, Rtools... . what is the best way? please advice.
>
> basically what i want to do is that, the Qt GUI will allow users to make
> selection and enter numbers, these inputs will be fed to R, already written
> .R files will perform the calculations, the calculation results
> (graphs/numbers) to be fed back and display in the GUI.
>
> graham
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Link-between-Qt-GUI-and-R-tp3804976p3804976.html
> Sent from the R devel mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel