Hello all and thanks in advance for any advice.
I am very new to R and have searched my question but have not come up with
anything quite like what I would like to do.

My problem is:

I have a data set for individuals (rows) and values for behaviours
(columns).  I would like to know the proportion of shared behaviours for all
possible pairs of individuals.  The sum of shared behaviours divided by the
total.  There are zeros in the data that I would like treated as the
behaviour does not exist.


example data format:

ind    B1  B2  B3  B4  B5  B6
w       2    1    5    3    4    4
x       1    2    3    4    5    6
y       1    3    5    2    7    6
z       2    3    2    4    2    6


Desired output:

w  x   0
w  y   0.166667
w  z   0
x   y   0.33333
x   z   0.33333
etc.


Thanks

Grant

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to