[R] a web interface to identify()

Paul Murrell p.murrell at auckland.ac.nz
Tue Dec 12 20:58:27 CET 2006


Hi


Jon Stearley wrote:
> i have a function like this:
>   # show a plot and run a script when the user clicks on a plot,
>   # where the script arguments correspond to the user-selected point.
>   blah <- function(x, y) {
>     plot(y~x)
>     n <- identify(x=x, y=y)
>     com <- system(command=paste("bleh", names(y)[n]))
>   }
> 
> i would like to do this via a web page instead of x11() etc.  eg:
>   1) a user clicks on an image in their web browser
>   2) the i,j coordinate is sent to the server
>   3) a single R process determines the nearest data point
>   4) the server sends a new page to the client, based on attributes  
> of the selected data point
> 
> i've browsed the R web interface options and frankly don't know which  
> to pick, or maybe they are all overkill for what i am trying to  
> accomplish?  perhaps the easiest thing to do is use ismap to capture  
> the i,j coords, the receiving cgi script connects to an R process for  
> the data lookup, and then responds to the browsing client  
> appropriately.  the data set involved is very large, so i'd need a  
> single R process sitting there waiting for such queries in order to  
> avoid initialize&load time - this is the part i am particularly  
> unclear how to do.
> 
> any ideas/suggestions/guidance on the best approach would be much  
> appreciated.  thank you.


Maybe Barry Rowlingson's imagemap is all you need?
http://www.maths.lancs.ac.uk/Software/Imagemap/

Paul
-- 
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
paul at stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/



More information about the R-help mailing list