Skip to content
Back to formatted view

Raw Message

Message-ID: <91C67180-E129-4410-A97F-C8798655239C@comcast.net>
Date: 2011-07-07T19:28:44Z
From: David Winsemius
Subject: How to make matrix missing data 0
In-Reply-To: <1310066460074-3652352.post@n4.nabble.com>

On Jul 7, 2011, at 3:21 PM, xin123620 wrote:

> Dear All,
>
> I am trying to analysis traffic data with one timestamp column and  
> speed
> column. This data set contains six years data; for each year, I want  
> to make
> a matrix in (day of the year) * (hour)
>         0  1  2   . . . 23
> 1
> 2
> .
> .
> 365
>
> However random day's record is missing(e.g. there are 40 missing  
> records in
> 2005 data set), when I tried to use tapply function, matrix came out  
> is
> 326*23 table and there were no N/A remind me which day is missing  
> data.
>
> Can you give some hints to make a 366*24 table please? Any help is
> appreciated.

More detail about what your data looks like and how you are importing  
it from file would be helpful.

(And please do read the Posting Guide where this request is spelled  
out in greater detail and where advice about successful attachment of  
datasets can be found.)
>
>
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


-- 
David Winsemius, MD
West Hartford, CT