Hi again,
I want to check a series for ties, meaning exact values that occur more
than once in the series, and also get the respective counts of how many
occurrences there are at each of these ties.
The function values() gives me information about the ties, as it drops
repeated values. But it seems it doesn't have the counts.
The function aggregate() is very general, and so I think for a series y
I could do:
matrix m = aggregate(y, y, mean)
Here the "mean" thing is just a redundant dummy entry, it could be
anything from the allowed functions (see the doc for 'aggregate').
Another redundancy is the double entry of "y", the first "y" could
also
be any other existing series, it's just needed to satisfy the number
(and position!) of arguments.
Then what I want to use are the first 2 cols of m: m[, 1:2].
So, is there a more elegant but still readable way to get the first two
columns of:
aggregate(<anyseries>, y, <anyfunction>)
Thanks,
sven