Plotting time graphs in R

By | January 4, 2014
x = c("10-21 10:37",
      "10-21 10:47",
      "10-21 10:55",
      "10-21 10:59",
      "10-21 11:48",
      "10-21 11:56")
y = c(37.57,
      37.59,
      37.71,
      37.75,
      37.83,
      37.89)

plot(strptime(x,format="%m-%d %H:%M"), y, type="l", xaxt="n")
axis(1,at=as.numeric(strptime(x,format="%m-%d %H:%M")),
       labels = strftime(strptime(x,format="%m-%d %H:%M"),
       format="%m-%d %H:%M"))

R time graph

Share
www.pdf24.org    Send article as PDF   

Leave a Reply

Your email address will not be published. Required fields are marked *


5 × = fifteen