I have got a dataframe containing measurement of aircraft noise like
this:
> Id <- c(1,4,5,2,3,6,4,1,2,5,6,3)
> Noise <- c(88,94,97,98,92,56,103,102,87,95,92,97)
> Height <- c(190, 150, 120, 115, 188, 104, 101, 189, 146, 111, 124,
126)
>
> df <- data.frame(Id, Noise, Height)
Now I would like to split this in two new dataframes. The first one
containing the rows with the maximum Noise for each Id and in the second
the other rows.
I manage to find that maximum Noise levels...
> m <- tapply(df$Noise, Id.factor, max)
> m
1 2 3 4 5 6
102 98 97 103 97 92
But how do I split my dataframe?
--
Ed Gordijn
Adviseur geluidscapaciteit
Amsterdam Airport Schiphol
Business Area Aviation (A/CAP/EC)
Postbus 7501, 1118 ZG Schiphol
Bezoekadres: Evert v/d Beekstraat 202, 1118 CP Schiphol
tel 020 601 32 22
fax 020 601 21 34
e-mail [EMAIL PROTECTED]
meer informatie is te vinden op www.schiphol.nl
--
-------------------------------------------------------------------
This e-mail may contain confidential and privileged material...{{dropped}}
______________________________________________
[email protected] 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.