I'm having trouble with some catch per unit effort data (CPUE, fisheries
data). Some of the samples were retained and some unretained, and they
are entered as 2 separate entries for the same sampling event (Date and
time). I want to calculate the total CPUE (so sum the retained and
unretained
Perhaps something like
# Untested
library(plyr)
ddply(DATA, Date, function(d) sum(d$lmb.cpue))
For example, on some fake data
DATA - data.frame(class = rep(letters[1:5], each = 2), type =
rep(c(good, bad), 5), value = rnorm(10))
ddply(DATA, class, function(d) sum(d$value))
If you want to send
2 matches
Mail list logo