Message-ID: <4E971704.2070303@uke.de>
Date: 2011-10-13T16:51:16Z
From: Eik Vettorazzi
Subject: Remove specific rows in a matrix/data.frame
In-Reply-To: <1318524164211-3902149.post@n4.nabble.com>
Hi Syrvn,
how about this
dtf<-read.table(textConnection("Letter Number
a 1
a 1
b 1
b 0
c 0
c 1
d 0
d 0"),header=T)
aggregate(Number~Letter,data=dtf,max)
cheers.
Am 13.10.2011 18:42, schrieb syrvn:
> Hi,
>
>
> imagine the following matrix/data.frame
>
> Letter Number
> a 1
> a 1
> b 1
> b 0
> c 0
> c 1
> d 0
> d 0
>
> If the numbers for two identical letters are also identical then I want to
> remove either the first or the
> second row of that letter. If for a letter the numbers are 1 and 0 I want to
> remove the row with the 0.
>
> That means if the code works I would and up with the following
> matrix/data.frame
>
> Letter Number
> a 1
> b 1
> c 1
> d 1
>
>
> Many thanks,
> Syrvn
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Remove-specific-rows-in-a-matrix-data-frame-tp3902149p3902149.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
--
Eik Vettorazzi
Department of Medical Biometry and Epidemiology
University Medical Center Hamburg-Eppendorf
Martinistr. 52
20246 Hamburg
T ++49/40/7410-58243
F ++49/40/7410-57790
--
Pflichtangaben gem?? Gesetz ?ber elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG):
Universit?tsklinikum Hamburg-Eppendorf; K?rperschaft des ?ffentlichen Rechts; Gerichtsstand: Hamburg
Vorstandsmitglieder: Prof. Dr. Guido Sauter (Vertreter des Vorsitzenden), Dr. Alexander Kirstein, Joachim Pr?l?, Prof. Dr. Dr. Uwe Koch-Gromus