[R] using object reference

Andy Bunn abunn at montana.edu
Tue Mar 2 23:16:25 CET 2004


Don't you just need to use return?

x <- 1
attr(x,'a') <- 'some text'
f <- function(z) {
  attr(z,'a') <- 'some new text'
  return(z)
}
y <- f(x)
y




More information about the R-help mailing list