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" number for each sampling event) and am having troubld doing so. Here's a sample of what my data.frame looks like now:
Date lmb.cpue Disposition.of.Catch 1999-07-10 12:10:00 0.66666667 Unretained 1999-07-10 12:10:00 0.16666667 Retained 1999-07-14 11:22:00 0.83333333 Unretained 1999-07-14 11:22:00 0.55555556 Retained 1999-07-14 11:48:00 0.16666667 Unretained 1999-07-14 11:48:00 0.58333333 Retained 1999-07-14 13:56:00 0.57142857 Retained 1999-07-15 10:23:00 0.11111111 Retained 1999-07-22 12:03:00 0.33333333 Retained 1999-07-25 11:26:00 0.40000000 Unretained 1999-07-25 11:26:00 1.00000000 Retained And I would like to end up with: Date lmb.cpue 1999-07-10 12:10:00 0.83333333 1999-07-14 11:22:00 1.38888889 1999-07-14 11:48:00 0.75000000 1999-07-14 13:56:00 0.57142857 1999-07-15 10:23:00 0.11111111 1999-07-22 12:03:00 0.33333333 1999-07-25 11:26:00 1.40000000 Thanks for any help you have to offer! -- View this message in context: http://r.789695.n4.nabble.com/how-to-sum-multiple-data-entries-for-the-same-sampling-event-tp4341670p4341670.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.