I am working with a large data set of arrivals, for each day I have
aggregated the arrivals into hrs (1-24) via: apply(x,2,table). On some days
there are zero arrivals during some hours of the day, this leaves me with
(I believe) a list of vectors of differnt lengths (see below).


[[4]]

 1  2  3  5  6  8  9 10 11 13 14 15 16 17 18 19 20 21 22 23 24
 1  3  2  3  1  1  2  3   4   4   4   3   2   6  2   5   1  2   2   2   1

[[5]]

2  5  6  8  9 10 11 12 13 14 15 16 17 18 19 20 22 23 24
2  1  1  2  1   5   3   6   6  3   2   2  1   4   3   3  4   2   1

 I would like to be able to create an array with equal numbers of rows (24)
for each column, i.e., fill in the gaps with Zeros.


[[5]]

1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20  21  22 23 24
0  2  0  0  1  1  0  2  1   5   3   6   6  3   2   2  1   4   3   0   3
4   2   1


Any suggestions?


thanks,

Spencer

        [[alternative HTML version deleted]]

______________________________________________
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
and provide commented, minimal, self-contained, reproducible code.

Reply via email to