title: R - Error with axis call: (list) object cannot be coerced to type 'double'
body: <p>I'd like to create a custom x-axis label like it was done here:
  <a href="http://blog.earlh.com/index.php/2009/07/plotting-with-custom-x-axis-labels-in-r-part-5-in-a-series/" rel="nofollow">http://blog.earlh.com/index.php/2009/07/plotting-with-custom-x-axis-labels-in-r-part-5-in-a-series/</a></p>
  
  <p>But when I'm trying to set the x axis label with:</p>
  
  <pre><code>at &lt;- format(SubDateTime$DateTime, "%H") %in% c("00", "06", "12", "18")
  axis(side = 1,at = SubDateTime$DateTime[at],
        labels = format(SubDateTime$DateTime[at], "%a-%H"))
  </code></pre>
  
  <p>I receive the following error:</p>
  
  <pre><code>Error in axis(side = 1, at = SubDateTime$DateTime[at], 
                labels = format(SubDateTime$DateTime[at],  
             : (list) object cannot be coerced to type 'double'
  </code></pre>
  
  <p>SubDateTime$DateTime is a POSIXlt class with two dates (2013-06-01 and 2013-06-02) and the hourly time. I want to add "Sun-00", "Sun-06", "Sun-12", etc to the x axis.</p>
  
  <p>Confusing to me is when I do the example from the link above it works fine.  </p>
  
  <p>Thx </p>
  
  <p>Edit:</p>
  
  <pre><code> plot(x = SubDateTime$DateTime,
   y = SubConsumption$Load.MW,
   type = "l",
   lwd = 2,
   ylim = c(0, max(SubConsumption$Load.MW, na.rm = FALSE)*1.2),
   main = "Spot Price June 01 to June 02",
   xlab = "",
   ylab = "",
   bty = "l",
   xaxt = "n")
  </code></pre>
  
  <p>What information about SubDateTime$DateTime do you need? </p>