Extracting time from POSIXct

后端 未结 6 683
梦如初夏
梦如初夏 2020-11-28 23:02

How would I extract the time from a series of POSIXct objects discarding the date part?

For instance, I have:

times <- structure(c(1331086009.5009         


        
6条回答
  •  既然无缘
    2020-11-28 23:19

    Many solutions have been provided, but I have not seen this one, which uses package chron:

    hours = times(strftime(times, format="%T"))
    plot(val~hours)
    

    (sorry, I am not entitled to post an image, you'll have to plot it yourself)

提交回复
热议问题