al Message-
From: Joshua Wiley [mailto:jwiley.ps...@gmail.com]
Sent: Friday, October 08, 2010 7:17 PM
To: Joe P King
Cc: r-help@r-project.org
Subject: Re: [R] saving object function
Hi Joe,
There is an important distinction between working with data and presenting
data. You do not want to
acters.
>
> Joe King
> 206-913-2912
> j...@joepking.com
> "Never throughout history has a man who lived a life of ease left a name
> worth remembering." --Theodore Roosevelt
>
>
>
> -Original Message-
> From: Joshua Wiley [mailto:jwiley.ps...@gmai
ng." --Theodore Roosevelt
-Original Message-
From: Joshua Wiley [mailto:jwiley.ps...@gmail.com]
Sent: Thursday, October 07, 2010 11:43 PM
To: Joe P King
Cc: r-help@r-project.org
Subject: Re: [R] saving object function
Hi Joe,
You can just put the results into a named list, fo
rg
Subject: Re: [R] saving object function
Hi Joe,
You can just put the results into a named list, for example:
functest<-function(x){
a <- x + 1
b <- x + 2
c <- x + 3
results <- list("a" = a, "b" = b, "c" = c)
return(results)
}
functest(1)$a
Hi Joe,
You can just put the results into a named list, for example:
functest<-function(x){
a <- x + 1
b <- x + 2
c <- x + 3
results <- list("a" = a, "b" = b, "c" = c)
return(results)
}
functest(1)$a
It is important to name the list or you would have to refer to it as:
functest(1)[[1]
5 matches
Mail list logo