title: What does the ts function do in R
body: <p>I have downloaded the historical prices between <code>Jan-1-2010</code> and <code>Dec-31-2014</code> for <strong><em>Twitter, Inc. (TWTR) -NYSE</em></strong> from <a href="http://finance.yahoo.com/q/hp?s=TWTR&amp;a=00&amp;b=1&amp;c=2010&amp;d=00&amp;e=1&amp;f=2015&amp;g=d" rel="nofollow noreferrer">YAHOO! FINANCE</a> in a <em>twitter.csv</em> file. </p>
  
  <p>I then loaded it into <em>RStudio</em> using:</p>
  
  <pre><code>x = read.csv("Z:/path/to/file/twitter.csv", header=T,stringsAsFactors=F)
  </code></pre>
  
  <p>Here is how table x looks like:</p>
  
  <pre><code>View(x)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/qmWh1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qmWh1.png" alt="enter image description here"></a></p>
  
  <p>Then I used <em>ts function</em> to get the time series of Adj.Close:</p>
  
  <pre><code>x.ts = ts(x$Adj.Close, frequency = 12, start=c(2010,1), end=c(2014,12)
  
  x.ts
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/V8CzY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V8CzY.png" alt="enter image description here"></a></p>
  
  <p>How the previous results have been obtained? They are really different from table x data. Do they need any adjustements?</p>