Dimitris Rizopoulos:
> dat[!duplicated(dat$Id), ]
Very elegant. I didn't know about 'duplicated()' before now.
Seems like a very useful function.
--
Karl Ove Hufthammer
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
Jojje Andersson:
> I have a dataframe with in one column an id-variable and in another a
> year-variable. One id-number can occur several years. I have sorted the
> dataframe on id then on year so the same id-number is sorted by year with
> the first occurens at top.
>
> Now I want to make a subs
If df is your dataframe, try
aggregate(df$Year,list(df$Id),min)
--- On Fri, 30/5/08, Jojje Andersson <[EMAIL PROTECTED]> wrote:
> From: Jojje Andersson <[EMAIL PROTECTED]>
> Subject: [R] Aggregate by First case
> To: "r-help@r-project.org"
> Received: Fri
Original Message -
From: "Jojje Andersson" <[EMAIL PROTECTED]>
To:
Sent: Friday, May 30, 2008 9:13 AM
Subject: [R] Aggregate by First case
Hello!
I have an maybe a to a simple question but I cant get it right.
I have a dataframe with in one column an id-variable and in ano
Hello!
I have an maybe a to a simple question but I cant get it right.
I have a dataframe with in one column an id-variable and in another a
year-variable. One id-number can occur several years.
I have sorted the dataframe on id then on year so the same id-number is sorted
by year with the fi
5 matches
Mail list logo