title: How can I segment data in R to include only points for which one of my variables is set to a specific value?
body: <p>I'm working with a data set that has 16 variables and more than 4,000 cases. I'd like to segment the data into a separate data frame that only includes cases for which one of the variables is set to 0.</p>
  
  <p>If I'm unclear, here's a simple example that, hopefully, will help illustrate my question:<br>
  Ana = red, 1<br>
  Beth = blue, 0<br>
  Cate = green, 3<br>
  David = yellow, 0</p>
  
  <p>How would I, through R, segment the data set to create a new data frame that omits the cases for which the second variable = 0? In this example, I would have a new data frame that only includes Ana and Cate. Likewise, how would I do the opposite, i.e. create a data frame with only Beth and David?</p>
  
  <p>Thank you for your help!</p>