Adding date to a vector of data

前端 未结 2 346
有刺的猬
有刺的猬 2020-12-22 08:28

Im having a little trouble with R and adding a date to a vector of data. I guess i\'m messing around with objects the wrong way?

Data: y (that is numeric[9])

<
2条回答
  •  伪装坚强ぢ
    2020-12-22 08:49

    Although the solution of @Roman Lustrik works, I think it is simpler:

    > y$date <- Sys.Date()
    > y
              a        b         c        d          e          f          g          h          i        j
    1 -1.104803 1.184856 0.9791311 1.866442 -0.3385167 0.04975147 -0.1821668 -0.7745292 -0.9261035 1.021533
            date
    1 2013-06-27
    

提交回复
热议问题