Thanks for your replies. I ended up using the following:
df = data.frame(year
=c(1991,1991,1992,1992,1993,1993,1992,1991),x=rnorm(8),y=rnorm(8))
df
year x y
1 1991 0.5565083 -1.31364232
2 1991 0.1686598 -0.20344656
3 1992 -0.1010090 -0.65681852
4 1992 0.6130324 -0.107
On Apr 24, 2009, at 11:56 AM, Jennifer Brea wrote:
I wanted to ask how I can make a for loop or a function return an R
object with a unique name based on either some XX of the for loop or
some input for the function.
For example
if I have a function:
fn<-function(data,year){
which does
I wanted to ask how I can make a for loop or a function return an R
object with a unique name based on either some XX of the for loop or
some input for the function.
For example
if I have a function:
fn<-function(data,year){
which does does some stuff
}
How do I return an object from the fu
3 matches
Mail list logo