Interface for R scripts
August 7, 2012 6:15 AM   Subscribe

What should I use to write a quick little front end to access a bunch of R programs?

Is there a nice drag&drop editor I can use to make a front end for a series of R programs? I would need radio buttons, list boxes, text boxes, etc. Something like the form editor which comes with excel would be fine. The most important consideration is ease of implementation.

Other factors: I would like to have the appearance of a stand-alone program. I am working in windows. This would be only for my use or for the use of a colleague or two.
posted by shothotbot to Computers & Internet (5 answers total) 3 users marked this as a favorite
 
Visual Basic Express Edition. It's free and pretty simple to use.
posted by mr_silver at 7:51 AM on August 7, 2012


Nothing beats VB when it comes to whipping up a quick and dirty GUI for windows.
posted by symbollocks at 8:04 AM on August 7, 2012


Response by poster: Nothing beats VB when it comes to whipping up a quick and dirty GUI for windows.

That's nice since I know VB. This might be a stupid question, but how do I link VB to R?
posted by shothotbot at 8:08 AM on August 7, 2012


Just google something like "calling r programs from visual basic". This looks like a decent introduction, but it's in C#, which is not all that different from vb for what you'll be using it for. They suggest using the COM interface for R, which you can get on this page (it's the second bullet point).
posted by symbollocks at 8:21 AM on August 7, 2012


Look at the System.Diagnostics.Process class - if your R code is well behaved (i.e. handles errors in input gracefuly, terminates without choking etc) this may be the easiest way to get things done - just run the R code in its own process and dump the output in a text file. The GUI code waits for termination and parses the output.

Look at BackgroundWorker as well if you want get fancy: it will let you move handling of the R process to another thread, so the interface doesn't lock up while you wait for termination.

I don't know anything about the COM interface to R, but COM in general has only been a source of frustration for me - if it's anything like MS Office or IE COM, expect lots of hanging, freezing and cryptic error messages.
posted by Dr Dracator at 10:15 PM on August 7, 2012


« Older Color accuracy in photos?   |   What are the after-effects of sexual harassment? Newer »
This thread is closed to new comments.