title: plotting time series in R
body: <p>I am working with data, 1st two columns are dates, 3rd column is symbol, and 4th and 5th columns are prices.
  So, I created a subset of the data as follows:</p>
  
  <pre><code>test.sub&lt;-subset(test,V3=="GOOG",select=c(V1,V4)
  </code></pre>
  
  <p>and then I try to plot a time series chart using the following</p>
  
  <pre><code>as.ts(test.sub)
  plot(test.sub)
  </code></pre>
  
  <p>well, it gives me a scatter plot - not what I was looking for.
  so, I tried <code>plot(test.sub[1],test.sub[2])</code>
  and now I get the following error:</p>
  
  <pre><code>Error in xy.coords(x, y, xlabel, ylabel, log) : 
    'x' and 'y' lengths differ
  </code></pre>
  
  <p>To make sure the no. of rows were same, I ran <code>nrow(test.sub[1])</code> and <code>nrow(test.sub[2])</code> and they both return equal rows, so as a newcomer to R, I am not sure what the fix is. </p>
  
  <p>I also ran <code>plot.ts(test.sub)</code> and that works, but it doesn't show me the dates in the x-axis, which it was doing with <code>plot(test.sub)</code> and which is what I would like to see.</p>
  
  <pre><code>test.sub[1]
                V1
  1107 2011-Aug-24
  1206 2011-Aug-25
  1307 2011-Aug-26
  1408 2011-Aug-29
  1510 2011-Aug-30
  1613 2011-Aug-31
  1718 2011-Sep-01
  1823 2011-Sep-02
  1929 2011-Sep-06
  2035 2011-Sep-07
  2143 2011-Sep-08
  2251 2011-Sep-09
  2359 2011-Sep-13
  2470 2011-Sep-14
  2581 2011-Sep-15
  2692 2011-Sep-16
  2785 2011-Sep-19
  2869 2011-Sep-20
  2965 2011-Sep-21
  3062 2011-Sep-22
  3160 2011-Sep-23
  3258 2011-Sep-26
  3356 2011-Sep-27
  3455 2011-Sep-28
  3555 2011-Sep-29
  3655 2011-Sep-30
  3755 2011-Oct-03
  3856 2011-Oct-04
  3957 2011-Oct-05
  4059 2011-Oct-06
  4164 2011-Oct-07
  4269 2011-Oct-10
  4374 2011-Oct-11
  4479 2011-Oct-12
  4584 2011-Oct-13
  4689 2011-Oct-14
  
  str(test.sub)
  'data.frame':   35 obs. of  2 variables:
   $ V1:Class 'Date'  num [1:35] NA NA NA NA NA NA NA NA NA NA ...
   $ V4: num  0.475 0.452 0.423 0.418 0.403 ...
  
  head(test.sub) V1 V4 
  1212 &lt;NA&gt; 0.474697 
  1313 &lt;NA&gt; 0.451907 
  1414 &lt;NA&gt; 0.423184 
  1516 &lt;NA&gt; 0.417709 
  1620 &lt;NA&gt; 0.402966 
  1725 &lt;NA&gt; 0.414264 
  </code></pre>
  
  <p>Now that this is working, I'd like to add a 3rd variable to plot a 3d chart - any suggestions how I can do that. thx!</p>