[R] How to extract Friday data from daily data.

thornbird huachang396 at gmail.com
Fri Nov 5 18:22:28 CET 2010


I am new to Using R for data analysis. I have an incomplete time series
dataset that is in daily format. I want to extract only Friday data from it.
However, there are two problems with it. 

First, if Friday data is missing in that week, I need to extract the data of
the day prior to that Friday (e.g. Thursday).

Second, sometimes there are duplicate Friday data (say Friday morning and
afternoon), but I only need the latest one (Friday afternoon). 

My question is how I can only extract the Friday data and make it a new
dataset so that I have data for every single week for the convenience of
data analysis. 

Your help and time will be appreciated. Thanks.  Kevin


Below is what my dataset looks like:

   views  number  timestamp day            time
1  views  910401 1246192687 Sun 6/28/2009 12:38
2  views  921537 1246278917 Mon 6/29/2009 12:35
3  views  934280 1246365403 Tue 6/30/2009 12:36
4  views  986463 1246888699 Mon  7/6/2009 13:58
5  views  995002 1246970243 Tue  7/7/2009 12:37
6  views 1005211 1247079398 Wed  7/8/2009 18:56
7  views 1011144 1247135553 Thu  7/9/2009 10:32
8  views 1026765 1247308591 Sat 7/11/2009 10:36
9  views 1036856 1247436951 Sun 7/12/2009 22:15
10 views 1040909 1247481564 Mon 7/13/2009 10:39
11 views 1057337 1247568387 Tue 7/14/2009 10:46
12 views 1066999 1247665787 Wed 7/15/2009 13:49
13 views 1077726 1247778752 Thu 7/16/2009 21:12
14 views 1083059 1247845413 Fri 7/17/2009 15:43
15 views 1083059 1247845824 Fri 7/17/2009 18:45
16 views 1089529 1247914194 Sat 7/18/2009 10:49

-- 
View this message in context: http://r.789695.n4.nabble.com/How-to-extract-Friday-data-from-daily-data-tp3029050p3029050.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list