From: Viechtbauer Wolfgang (STAT) <Wolfgang.Viechtbauer_at_stat.unimaas.nl>

Date: Fri, 29 Feb 2008 10:02:09 +0100

}

Date: Fri, 29 Feb 2008 10:02:09 +0100

So, for a simple example, suppose I want to do this with the following function:

dosomething <- function(x, data) {

temp <- x^2 + 5 return(temp)

}

How does the function need to be changed, so that dosomething(somevariable, data=somedataframe) will find somevariable within the dataframe somedataframe and if dosomething(somevariable) is called, the function should find somevariable in the parent frame (or anywhere else in the search path)?

Thanks for any help!

-- Wolfgang ViechtbauerReceived on Fri 29 Feb 2008 - 09:05:54 GMT

Department of Methodology and Statistics

University of Maastricht, The Netherlandshttp://www.wvbauer.com/

______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.2.0, at Fri 29 Feb 2008 - 11:30:17 GMT.

*
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help.
Please read the posting
guide before posting to the list.
*