On Tue, Nov 23, 2010 at 11:49 AM, Santosh Srinivas
<santosh.srini...@gmail.com> wrote:
> Thanks. Sorry about the naming (just cobbled the example).
> The rows are duplicate in the actual data. I am looking for a way to find
> the number of duplicate rows for each unique rowindex combination which is
> based on columns 1:6.
>
>

Try this:

   Ag <- aggregate(TrdPrice ~., DF2[1:7], length)
   names(Ag)[7] <- "length"

where DF2 was defined previously.

Note that when you read in the data into zoo you can aggregate it at
the same time using the aggregate argument to read.zoo.  For
example, note the aggregate argument in the following:

   z <- read.zoo(DF2[c(1:2, 4, 6:8)], split = 2, tz = "", aggregate =
function(x) tail(x, 1))

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.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.

Reply via email to