title: Extract part of time serie with R
body: <p>I have a ts (time serie) object in R that contains long periods of missing value. I would like to extract a part of it and keep the time series object.</p>
  
  <p>for example with the AirPassengers Data:</p>
  
  <pre><code>class(AirPassengers) 
  #output: "ts"
  </code></pre>
  
  <p>but if I extract only the 10 first month</p>
  
  <pre><code>AirPassengers[1:10]
  #output: [1] 112 118 132 129 121 135 148 148 136 119
  
  class(AirPassengers[1:10])
  #output: "numeric"
  </code></pre>
  
  <p>How can I simply extract a part of my time serie without loosing the ts class?</p>