R-beta: dataframes and functions

Martyn Plummer plummer at iarc.fr
Wed Feb 18 11:15:34 CET 1998

On 18-Feb-98 Jim Lindsey wrote:
>As I guessed, globality of dataframes in functions is another one of
>those wonderful S-Plus features. Is there any advantage  to this???

Well, I'm not going to argue the logic of it with you, but S compatibility
is usually regarded as a feature rather than a bug. It might conceivably
be useful for different functions to manipulate variables in the same
data frame without passing the data frame as an argument, but I don't
have a strong opinion.

>  Note that an undetached dataframe `disappears' when the function
>exits. But the invisible variables it contained do not. I had about 30
>invisible copies of the variables that ls() could not see. But one
>called factor kept giving a warning message (outside the original
>function) so I knew something fishy was going on. What possibly could
>be the advantage of such behaviour?

I can't duplicate the behaviour your are describing. Perhaps I
have misunderstood. Could you post a simple example?

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list