[R] Removing rows w/ smaller value from data frame

PIKAL Petr petr.pikal at precheza.cz
Thu May 23 16:35:03 CEST 2013


Hi

change max_dt do PISIX class and use standard comparison operator and use the result for selecting rows.

> s<-seq(c(ISOdate(2000,3,20)), by = "day", length.out = 10)
> s<s[5]
 [1]  TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE
>

Regards
Petr


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of ramoss
> Sent: Thursday, May 23, 2013 4:24 PM
> To: r-help at r-project.org
> Subject: [R] Removing rows w/ smaller value from data frame
> 
> Hello,
> 
> I have a column called max_date in my data frame and I only want to
> keep the bigger values for the same activity.  How can I do that?
> 
> data frame:
> 
> activity    max_dt
> A            2013-03-05
> B             2013-03-28
> A             2013-03-28
> C             2013-03-28
> B             2013-03-01
> 
> Thank you for your help
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/Removing-
> rows-w-smaller-value-from-data-frame-tp4667816.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.



More information about the R-help mailing list