[R] generic function-method arguments accessible by tab-key

Robert Bauer robertbauer1603 at gmx.de
Tue Apr 15 23:27:13 CEST 2014


found the solution:

v <- function(x, ...) UseMethod("v")

setMethod('v', signature(x='character'), function(x, ...) v.print(x, ...))
setMethod('v', signature(x='numeric'), function(x, ...) v.numeric(x, ...))

v.print <- function(x,y=x,z=x) print(paste(x,y,z))
v.numeric <- function(x,u=3*x) print(u*x)

examples:
v(1)
v('a')

The tab-key after typing 'v( gives:
x=
...
u=
y=
z=



--
View this message in context: http://r.789695.n4.nabble.com/generic-function-method-arguments-accessible-by-tab-key-tp4688793p4688859.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list