Skip to content
Prev 298155 / 398498 Next

dropping variables from a data frame inside a function

I think the OP might also be tripped up on the fact that R is
pass-by-value so effects on df inside DropLikeSAS won't have impact
outside the function's scope. The df inside of DropLikeSAS() is
changed as expected, but that has no effect on the df outside that
function.

To the OP: There are ways to get pass-by-reference behavior (which I
think is what you are expecting), but the default is pass-by-value for
good reason. Give it a shot for a while and see if you come to like it
-- I think you will.

Best,
Michael
On Fri, Jun 22, 2012 at 4:22 PM, David Winsemius <dwinsemius at comcast.net> wrote: