title: Creating Date Time Time Series Objects and Plotting
body: <p>I have a lot of temperature data collected continuously on 15-minute intervals in dd/mm/yyyy hh:mm:ss. I am novice at R, and I am struggling plotting the data.   That code I wrote is:</p>
  
  <pre><code>install.packages("xts")
  library("xts")
  
  temp&lt;-read.csv("C:\\Users\\data\\Temp Data.csv",header=TRUE)
  str(temp)
  
  temp$DateTime&lt;-as.POSIXct(strptime(temp$DateTime,"%m/%d/%Y %H:%M"))
  
  temp.xts&lt;-xts(temp,order.by=temp$DateTime)
  summary(temp.xts)
  
  par(mfrow=c(1,1))
  
  Temp.lab=seq(5,30,by=5)
  Temp.ticks=seq(5,30,by=5)
  plot(temp.xts$Temp.C["2015-05-01/2015-11-5"],axes=F,auto.grid=FALSE,col="gray48",ylim=c(5,30),main="",cex.main=1.0,lwd=1)
  axis(2,at=Temp.ticks,labels=format(Temp.lab,scientific=FALSE),ylab="Temperature (C)",las=1,cex.axis=1)
  mtext("Water Temperatuer",side=3,line=-1.25,cex=1,font=2,las=1,adj=0.025)
  mtext("",side=2,line=3,las=3,cex=1)
  mtext("",side=1,line=3,cex=1)
  </code></pre>
  
  <p>When I run these I get the error: Error in plot.xts(temp.xts$Temp.C["2015-05-01/2015-11-15"], axes = F,  : 
    'x' must be a time-series object.</p>
  
  <p>The structure of my data looks like;</p>
  
  <blockquote>
    <p>head(temp)
      Station.ID            DateTime Temp.C
    1 Station.01 2015-05-08 14:00:00 14.002
    2 Station.01 2015-05-08 14:15:00 13.906
    3 Station.01 2015-05-08 14:30:00 13.978
    4 Station.01 2015-05-08 14:45:00 14.026
    5 Station.01 2015-05-08 15:00:00 14.074
    6 Station.01 2015-05-08 15:15:00 14.098</p>
    
    <p>str(temp)
    'data.frame':   18283 obs. of  3 variables:
     $ Station.ID: Factor w/ 1 level "Station.01": 1 1 1 1 1 1 1 1 1 1 ...
     $ DateTime  : Factor w/ 18279 levels "10/1/2015 00:00",..: 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 ...
     $ Temp.C    : num  14 13.9 14 14 14.1 ...</p>
  </blockquote>
  
  <p>Here is a snippet of my dataset:</p>
  
  <p>head(temp,20)
          Station.ID       DateTime Temp.C
       1  Station.01 5/8/2015 14:00 14.002
       2  Station.01 5/8/2015 14:15 13.906
       3  Station.01 5/8/2015 14:30 13.978
       4  Station.01 5/8/2015 14:45 14.026
       5  Station.01 5/8/2015 15:00 14.074
       6  Station.01 5/8/2015 15:15 14.098
       7  Station.01 5/8/2015 15:30 14.122
       8  Station.01 5/8/2015 15:45 14.146
       9  Station.01 5/8/2015 16:00 14.146
       10 Station.01 5/8/2015 16:15 14.146
       11 Station.01 5/8/2015 16:30 14.146
       12 Station.01 5/8/2015 16:45 14.146
       13 Station.01 5/8/2015 17:00 14.122
       14 Station.01 5/8/2015 17:15 14.122
       15 Station.01 5/8/2015 17:30 14.122
       16 Station.01 5/8/2015 17:45 14.098
       17 Station.01 5/8/2015 18:00 14.122
       18 Station.01 5/8/2015 18:15 14.098
       19 Station.01 5/8/2015 18:30 14.098
       20 Station.01 5/8/2015 18:45 14.098</p>
  
  <pre><code> Any suggestions? Help is greatly appreciated.
  </code></pre>