Re: [R] Define return values of a function

2009-11-23 Thread Greg Snow
Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of soeren.vo...@eawag.ch > Sent: Sunday, November 22, 2009 4:27 AM > To: r-help@r-project.org &

Re: [R] Define return values of a function

2009-11-22 Thread David Winsemius
On Nov 22, 2009, at 6:26 AM, soeren.vo...@eawag.ch wrote: I have created a function to do something: i <- factor(sample(c("A", "B", "C", NA), 793, rep=T, prob=c(8, 7, 5, 1))) k <- factor(sample(c("X", "Y", "Z", NA), 793, rep=T, prob=c(12, 7, 9, 1))) mytable <- function(x){ xtb <- x btx

Re: [R] Define return values of a function

2009-11-22 Thread baptiste auguie
hi, Try making your last line invisible( list(table=xtb, elbat=btx) ) HTH, baptiste 2009/11/22 Soeren.Vogel : > I have created a function to do something: > > i <- factor(sample(c("A", "B", "C", NA), 793, rep=T, prob=c(8, 7, 5, 1))) > k <- factor(sample(c("X", "Y", "Z", NA), 793, rep=T, prob

[R] Define return values of a function

2009-11-22 Thread Soeren . Vogel
I have created a function to do something: i <- factor(sample(c("A", "B", "C", NA), 793, rep=T, prob=c(8, 7, 5, 1))) k <- factor(sample(c("X", "Y", "Z", NA), 793, rep=T, prob=c(12, 7, 9, 1))) mytable <- function(x){ xtb <- x btx <- x # do more with x, not relevant here cat("The table