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. -- +--------------------------------------------------------------+ | Jon Stearley (505) 845-7571 (FAX 844-9297) | | Sandia National Laboratories Scalable Systems Integration | +--------------------------------------------------------------+
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/