Daniel,
I'm not sure if this is what you're after, but you could include a print()
call in your function. For example:
myfun <- function(x) {
m1 <- min(x)
m2 <- mean(x)
m3 <- max(x)
out <- list(m1, m2, m3)
print(out[[2]])
return(out)
}
result <- myfun(1:10)
Jean
On Mon, Jul 13,
On 13/07/2015 5:06 PM, Daniel Caro wrote:
> Hello,
>
> Sorry if this has already been addressed before but I could not find any
> helpful references.
>
> I would like to create a function that outputs a single element of a list
> but stores all elements, similar to 'lm' and many other functions.
Hello,
Sorry if this has already been addressed before but I could not find any
helpful references.
I would like to create a function that outputs a single element of a list
but stores all elements, similar to 'lm' and many other functions. There
are several answers on how to return multiple obj
3 matches
Mail list logo