[R] Method dispatch for function call operator?

Taras Zakharko taras.zakharko at gmail.com
Thu Jan 13 11:32:52 CET 2011


Thank you both for very helpful answers. I have indeed missed the help pages
about "(" and now the situation is more clear.

> You can use this syntax by defining a function `x<-` <- function(...) {} 
> and it could be an S3 method, but it is a completely separate object from
> x.  

Unfortunately, it won't work as assignment function form treats the first
argument specially. My intention was to create syntactic sugar like

x$metadata(condition) <- newvalue

instead of 

x$setMetadata(condition, value=newvalue)

I know that

metadata(x, condition) <- newvalue 

would work, but I would like to avoid that particular syntax for a number of
reasons.

Well, you can't have everything, I guess. I'll just stick to the []
operator.

Thanks again for the clarification!

-- 
View this message in context: http://r.789695.n4.nabble.com/Method-dispatch-for-function-call-operator-tp3215381p3215590.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list