R programming function without ()

Posted by Mark Kennedy on Stack Overflow See other posts from Stack Overflow or by Mark Kennedy
Published on 2011-11-15T01:34:27Z Indexed on 2011/11/15 1:51 UTC
Read the original article Hit count: 102

Filed under:
|
|

So, I Have the following very simple map.r file.

I'm trying to have the user type "click" in interactive mode and then have the function .

Since it's a function, the user has to type "click()" how can I make it so that they only have to the word (w/o parentheses), and then have that function do something with the img.

So the user types:

mydist("image.pnm")

click

//And then the function click does what it's supposed to

mydist <- function(mapfile) {

    img <- read.pnm(mapfile)

    plot(img)
}

click <- function() {

    //Prompt user to click on img
}

© Stack Overflow or respective owner

Related posts about r

    Related posts about function