Re: [R] choose between dates and times

From: bogdan romocea <br44114_at_gmail.com>
Date: Wed 27 Jul 2005 - 06:16:05 EST


If happenat is not a datetime value, convert it with strptime(). Then, one solution is to transform it in the following way: num.time <- as.numeric(format(happenat,"%Y%m%d%H%M%S")) This way, 07/22/05 00:05:14 becomes 20050722000514, and you can subset your data frame with
dfr[which(num.time >= 20050725153000 & num.time <= 20050726123000),] hth,
b.

> -----Original Message-----
> From: Kerry Bush [mailto:kerryrekky@yahoo.com]
> Sent: Tuesday, July 26, 2005 3:54 PM
> To: r-help@stat.math.ethz.ch
> Subject: [R] choose between dates and times
>
>
> Dear R-helpers,
> I have the following data:
>
> y happenat x
> 5185 (07/22/05 00:05:14) 14
> 5186 (07/22/05 00:15:14) 14
> 5187 (07/22/05 00:25:14) 14
> 5188 (07/22/05 00:35:14) 14
> ......
>
> I want to choose between 07/25/05 15:30:00 and
> 07/26/05 12:30:00. Anybody had experience in handling
> this kind of data? Is there a simple way to subset by
> the variable 'happenat'? Thanks.
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jul 27 06:19:35 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:34:01 EST