[R-gui] regression diagram builder thingie? Maybe like Doodle in Winbugs?

Adrian Waddell adrian at waddell.ch
Tue Jun 26 04:14:50 CEST 2012


Hello all,

I can not speak for QT nor GTK, but for tcl/tk, Java2d and the HTML5 canvas I can.

The tk canvas widget offers you some nice things out of the box: i.e. you can draw some shape onto the tk canvas and give it a tag. You then can specify what should happen if a user moves the mouse over a shape with some specific tag, or clicks on it etc... (Event bindings).

In Java2d and the HTML5 canvas (to my knowledge), out of the box, you listen to events and then need to figure out yourself what shape/element the mouse was over at the time of the event. You probably would want to use a framework such as Piccolo2d for Java or another scene graph implementation, but the decision on the best framework might not be easy to make, and you also need to learn these frameworks. Often, these frameworks and also the Java2d library itself make use of patterns. Hence, if you are new to programming or have not read any books on patterns you might find the way things are done a bit complicated. In this case, tcl/tk is good.

You also need to consider what Ian previously wrote: tcl/tk works pretty much with most R installations.

Your project sounds quite involved. You may consider to use tk to create a working prototype and then assess the situation new.

Personally, I like tcl/tk, but I would choose something else for a large scale project. However then I would probably also stick to the language with the best integration for a particular toolkit, i.e. Java or C++ often times. You will find many threads on stackoverflow on toolkit1 vs toolkit2. Qt and Gtk+ are probably the most popular ones at this time. (And of course the HTML 5 canvas, which is early wave however).

If you decide on a toolkit, let me/us know and maybe I/we can give you some input on how to start.

Adrian




On 12-06-25 04:13 PM, Paul Johnson wrote:
> So, just to be blunt:
> 
> You like working with tcltk?
> 
> I mean, I know your package is written with it, but do like it? Do you
> sometimes wish you were working with QT or GTK? That's the hard
> decision for me at the moment.
> 
> pj
> 
> 
> On Mon, Jun 25, 2012 at 12:19 PM, Greg Snow <538280 at gmail.com> wrote:
>> Look at the TkIdentify function in the TeachingDemos package.  It does
>> not do what you want completely, but it shows an example of dragging
>> and dropping labels within a plot in R.  You could do something
>> similar with your variable names to drag and drop them to different
>> locations (and possibly arrows or lines).  Then you just need to
>> decide how to use the position information to build your model.
>> However, this seems rather complicated, how will you indicate
>> interactions or non-linearity?  I could see this for very basic
>> models, but not for more general ones.
>> 
>> On Tue, Jun 19, 2012 at 2:05 PM, Paul Johnson <pauljohn32 at gmail.com> wrote:
>>> I'd like to have an R program that allows users to design regression
>>> equations by dragging variables around in a canvas, to interactively
>>> build path diagrams that lead to regressions. The diagrams would
>>> generate code that would run, and then results would somehow be linked
>>> to the drawings, perhaps showing coefficients on the edges or such.
>>> 
>>> I'd like this thing to facilitate multilevel modeling if possible, but
>>> I'd settle to just have a pallet of variable "nodes" that can be
>>> pulled out of a box on the side and re-positioned in the canvas, with
>>> arrows pointing in and out. If that could generate code to run glm,
>>> I'd be happy.
>>> 
>>> Then I'd like to generalize this so that the nodes could represent
>>> latent variables in a structural equation model.  Maybe I'd fiddle it
>>> up to write code for fitting with lavaan's estimators.
>>> 
>>> Has anybody tried to do such a thing?  Anybody know where to start?
>>> 
>>> If you were doing this, which of the graphical programming
>>> environments would you suggest?  I want this to work more-or-less well
>>> on all platforms. I've Googled enough to know it is not easy to decide
>>> which path to follow.  My first idea was to imitate the design of
>>> programs that draw mind maps, but they are mostly based on Java, which
>>> in my experience is hard to support for diverse platforms. Still, the
>>> JGR project seems to do well with it, so I'm not absolutely opposed.
>>> 
>>> I've been looking at GTK2, QT4, WXwidgets and tcltk. Judging from what
>>> I read in the email lists of various development projects, perhaps QT4
>>> is the least troublesome multi-platform gui library, but it is not
>>> entirely open/free.  QT, of course, is the underlying framework of the
>>> KDE desktop.  My favorite editor, LyX, is written with QT, so I am
>>> sure it works. The Gambit game theory project chose WX.  It appears to
>>> me that tcltk is constantly on the brink of extinction, and yet new
>>> versions pop out now and then.
>>> 
>>> In WinBUGS, there's a graphical model designer called Doodle that is
>>> quite pleasing to me, but it seems there must be something wrong with
>>> it because nobody boasts about it very much :(
>>> 
>>> pj
>>> --
>>> Paul E. Johnson
>>> Professor, Political Science    Assoc. Director
>>> 1541 Lilac Lane, Room 504     Center for Research Methods
>>> University of Kansas               University of Kansas
>>> http://pj.freefaculty.org            http://quant.ku.edu
>>> 
>>> _______________________________________________
>>> R-SIG-GUI mailing list
>>> R-SIG-GUI at r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-gui
>> 
>> 
>> 
>> --
>> Gregory (Greg) L. Snow Ph.D.
>> 538280 at gmail.com
> 
> 
> 



More information about the R-SIG-GUI mailing list