Skip to content
Prev 155744 / 398502 Next

Handling time-series-Data

On Thu, Sep 11, 2008 at 3:37 AM, Kunzler, Andreas <a.kunzler at bzaek.de> wrote:
Don't you mean 1 person, not 2 persons, since
- attendant 1 appears in both years but
- attendant 2 appears only in 2006
- attendant 3 appears only in 2007
so only attendant 1 appears in both years, i.e. 1 person.

Assuming DF is your data frame:

u <- unique(DF[1:2])
with(u, sum(tapply(y, I, length) == length(unique(y))))  # 1