Here is the description of these two operators from the doc An Introduction to R:
M_1 : M_2
The tensor product of M_1 and M_2. If both terms are factors, then the “subclasses” factor.
M_1 %in% M_2
Similar to M_1:M_2, but with a different coding.
This does not actually tell the difference between the two. My questions are,
- What's the difference between
M_1 : M_2
andM_1 %in% M_2
as formula notations, or under what circumstances do we have to use the former or the latter? - What does
with a different coding
mean in this context?