Displaying 1 result from an estimated 1 matches for "brco".
Did you mean:
brc
2008 Jul 04
1
by or tapply?
...s,
I have a data frame that is similar to the one below.
The row names are species and the E1, E2, E3 columns are presence/absence for a given site. I have an additional column 'origin' which has information about the species.
E1 E2 E3 origin
BASA 0 0 1 N
BASO 0 0 1 N
BRCO 0 0 1 U
CAER 0 0 0 E
CAGI 0 1 0 C
CEFL 0 1 1 N
I want to get the sum of ALL of the sites for the factors in the column 'origin'.
I have used
by(merge[,2],merge$origin,sum)
and
tapply(merge[,2],merge$origin,sum)
but this just gives me one column at a time...