Skip to content
Prev 342789 / 398506 Next

mutually exclusive events

On Sat, Aug 2, 2014 at 1:11 PM, Adrian Johnson
<oriolebaltimore at gmail.com> wrote:
I am having trouble visualizing your data. How about a sample? The
easy is to do something like:

temp <- head(realData,10);
dput(temp);

Then cut'n'paste the output from the dput() into another email here.

But, asuming I have a bit of a grasp, you have four columns (example
only shows 3). If you have a set of columns which are 0 & 1 or FALSE
and TRUE, then you can create a "temp" column which encodes tehm
simply by considering them to be binary digits in a number. I.e.
tempColumn = 1 * column1 + 2 * column2 + 4*column3 + 8*column4. You
can the "group" the data by this value. All rows with the same value
are in the same "group". But I don't know what you want your output to
look like. As an aside any value other than 0, 1, 2,4, or 8 could be
considered invalid because it means that more than one column is TRUE,
which violates your constraint.