title: Subset data and plotting in R
body: <p>I would like to use R to simplify and subset large datasets (over 100 000 values) and then plot them. Below is a simplified version of my dataset (Figure 1) where I broke it down into three years and two crop types. I have a Year (2011-2013), two crop types (Corn and Soybean) and their total Area. </p>
  
  <p>I want to subset the data into the total Area of Corn and Soybean by year into a new table(example figure 2) with the year, type and total area and then plot the total area by year for each (example of plot in Figure 3). </p>
  
  <p><a href="https://i.stack.imgur.com/DWPsz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DWPsz.png" alt="enter image description here"></a> </p>
  
  <p>Figure 1 Small example dataset</p>
  
  <p><a href="https://i.stack.imgur.com/cbTlV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cbTlV.png" alt="enter image description here"></a></p>
  
  <p>Figure 2 New total table </p>
  
  <p><a href="https://i.stack.imgur.com/ckb8Q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ckb8Q.png" alt="small data sample"></a></p>
  
  <p>Figure 3 example of graph that I want to produce</p>
  
  <p>I thought I could subset the data by year and crop with</p>
  
  <p>corn2011 &lt;- subset(CropTable, Year==2011 &amp; Lulc=="Corn")</p>
  
  <p>corn2012 &lt;- subset(CropTable, Year==2012 &amp; Lulc=="Corn")</p>
  
  <p>and then I can summarize the data using the sum function </p>
  
  <p>sum(corn2011[,3]),</p>
  
  <p>but I'm not sure how to plot them yearly or against each other to have it look like Figure 3.</p>