Re: [R] The curious special case of "~ (a + b)/c"

From: Nathaniel Smith <njs_at_pobox.com>
Date: Sat, 05 Jun 2010 16:09:30 -0700

On Sat, Jun 5, 2010 at 2:01 PM, RICHARD M. HEIBERGER <rmh_at_temple.edu> wrote:
> The "/" is used for nesting and is defined by
> A/B == A + (B %in% A)
>
> thus
> (a+b)/c == (a+b) + c %in% (a+b) == a + b + a:b:c

...I guess I could then ask why %in% is defined that way, but actually this rephrasing somehow helped me figure it out :-). In case anyone else with the same confusion finds this thread: the point in either case is that a variable can't be nested in two other variables separately, so the user must have meant it was nested in both together.


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. Received on Sat 05 Jun 2010 - 23:11:22 GMT

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 Sun 06 Jun 2010 - 04:40:28 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.

list of date sections of archive