Dear all, when I put date objects (class of 'Date') in a matrix it becomes
numeric:

> dat <- matrix(seq(as.Date("2011-01-01"), as.Date("2011-01-09"), by="1
day"), 3)

> dat

      [,1]  [,2]  [,3]

[1,] 14975 14978 14981

[2,] 14976 14979 14982

[3,] 14977 14980 14983

> class(dat[1,1])

[1] "numeric"

 

As it could not preserve the 'Date' characteristics after putting my Date
observations, I find it difficult to carry forward further calculation with
Dates. Can somebody help me on how to preserve the Data properties while
storing them within some matrix?

 

Thanks


	[[alternative HTML version deleted]]

