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

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

On Sat, Jun 5, 2010 at 2:01 PM, RICHARD M. HEIBERGER <> 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. mailing list PLEASE do read the posting guide 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 Please read the posting guide before posting to the list.

list of date sections of archive