Skip to content
Prev 305281 / 398506 Next

How to append the random no.s for different variables in the same data.frame

On Wed, Sep 12, 2012 at 7:51 AM, Vincy Pyne <vincy_pyne at yahoo.ca> wrote:
No: if you want to return multiple values, put them in a list and return that:

f <- function(n, nn){
   x <- rnorm(n)
   y <- rexp(nn)
   ret <- list(x = x, y = y)
   return(ret)
}

Cheers,
M