[R] deleting data of a given date range.

PIKAL Petr petr.pikal at precheza.cz
Thu Nov 29 17:05:26 CET 2012


Hi


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of siddanth911
> Sent: Thursday, November 29, 2012 12:10 PM
> To: r-help at r-project.org
> Subject: [R] deleting data of a given date range.
> 
> hey,
> 
> I have a huge dataset with over 300000 rows which contains data about
> something from 2009-2012. does anyone know how i can delete all the
> rows which contain data from 2009 and only have data from 2010-2012???
> is there a particular function i can use on the date column so that all
> data from 2009 can be deleted???

It depends on structure of your data (unstated). If I presume that you have data frame and you have date in some column you can just use standard subsetting

new.data <- your.data[your.data$Date > some.threshold.Date, ] 

Regards
Petr



> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/deleting-
> data-of-a-given-date-range-tp4651272.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