title: How to remove a certain time period in zoo format
body: <p>I have a time-series data in <code>zoo</code> format and another 2 variables data frame in <code>POSIXct</code> format recorded the 7 pairs of staring and ending time which represent the time ranges that should be removed . The figure below illustrated the questions graphically. The highlighted regions are the region I have already identified and are expected to be removed.</p>
  
  <p>I know that <code>window</code> function can be used to extract these regions, but is there an elegant way to simply remove the data in this region?</p>
  
  <p>Put it simple, any way to delete several periods in a time-series like using the minus (-) sign to remove columns or rows in data frame? </p>
  
  <p><a href="https://i.stack.imgur.com/BY3UD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BY3UD.jpg" alt="Illustration"></a></p>
  
  <p><strong>Supplementary</strong> </p>
  
  <p>The identified period is in a data frame as shown below (in <code>POSIXct</code> format)</p>
  
  <p>The time series data is in standard zoo format</p>
  
  <p><a href="https://i.stack.imgur.com/4mgUj.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4mgUj.jpg" alt="enter image description here"></a></p>