title: R: Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ
body: <p>I'm trying to find the correlation between two stocks in R: </p>
  
  <pre><code>library(quantmod)
  tickers = c("CAT", "AAPL")
  stocks = getSymbols(tickers, auto.assign=TRUE)
  plot(as.numeric(dailyReturn(Ad(CAT))),as.numeric(dailyReturn(Ad(AAPL)))
        ,xlab="CAT",ylab="AAPL",main="Scatterplot of CAT vs AAPL Daily Returns")
  </code></pre>
  
  <p>but I get the error "Error in xy.coords(x, y, xlabel, ylabel, log) :    'x' and 'y' lengths differ" -- how do I resolve this?</p>