Re: [R] accessing return variables from a function

2010-07-10 Thread Noah Silverman
Thanks! -N On 7/9/10 2:20 AM, Noah Silverman wrote: > Hi, > > I am trying to figure out a "short" way to access two values output from > the sort function. > > >> x <- c(3,4,3,6,78,3,1,2) >> sort(x, index.return=T) >> > $x > [1] 1 2 3 3 3 4 6 78 > > $ix > [1] 7 8 1 3 6 2 4 5 > > >

Re: [R] accessing return variables from a function

2010-07-09 Thread Eik Vettorazzi
which is just unlist(sort(x, index.return=T)) but I think, Noah would like to have something like srt<-sort(x, index.return=T) names(srt)<-c("y","indexes") attach(srt) but that is wasteful either. Am 09.07.2010 12:28, schrieb David Winsemius: > > On Jul 9, 2010, at 5:20 AM, Noah Silverman wrote

Re: [R] accessing return variables from a function

2010-07-09 Thread Barry Rowlingson
On Fri, Jul 9, 2010 at 10:20 AM, Noah Silverman wrote: > Hi, > > I am trying to figure out a "short" way to access two values output from > the sort function. > >>x <- c(3,4,3,6,78,3,1,2) >>sort(x, index.return=T) > $x > [1]  1  2  3  3  3  4  6 78 > > $ix > [1] 7 8 1 3 6 2 4 5 > > > It would be g

Re: [R] accessing return variables from a function

2010-07-09 Thread David Winsemius
On Jul 9, 2010, at 5:20 AM, Noah Silverman wrote: Hi, I am trying to figure out a "short" way to access two values output from the sort function. x <- c(3,4,3,6,78,3,1,2) sort(x, index.return=T) $x [1] 1 2 3 3 3 4 6 78 $ix [1] 7 8 1 3 6 2 4 5 It would be great to do something l