Do you pass in gg as an input? If not, then you just want treat:
at.func<- function(arg1, arg2, treat, arg4) {
. . .
tt<- teh[ ,treat==1]
. . .
}
----- Original Message -----
From: "Andrew Eggers" <aeggers(a)gmail.com>
To: <gov2001-l(a)lists.fas.harvard.edu>
Sent: Thursday, December 09, 2004 11:40 AM
Subject: [gov2001-l] arguments in functions
Hello all,
Thanks for the help on setx() before.
I think I am having a problem with passing arguments into a function.
I want my function to have a line that says
tt<- teh[,gg.r$treat==1]
for various "treat"s. (this is for generating the ATT -- the columns
of teh where the treatment was applied.) So my function is like
at.func<- function(arg1, arg2, treat, arg4) {
. . .
tt<- teh[,gg.r$treat==1]
. . .
}
When I do this for a particular value of treat outside of the function,
ie,
tt<- teh[,gg.r$phone==1]
it works fine, but in passing the argument within the function it
seems to not understand this. (tt is empty). Can anyone help me with
this?
Andy
_______________________________________________
gov2001-l mailing list
gov2001-l(a)lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l