title: Check whether a row with values belongs to a data frame in R
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5916854/existing-function-for-seeing-if-a-row-exists-in-a-data-frame">Existing function for seeing if a row exists in a data frame?</a>  </p>
  </blockquote>
  
  
  
  <p>Suppose I have the following data frame in R.</p>
  
  <pre><code>df = data.frame('a'=c(1:3), 'b'=c(4:6))
  </code></pre>
  
  <p>This data frame contains three rows: <code>(1,4), (2,5) and (3,6)</code>. Suppose I did not know which rows <code>df</code> contains and wanted to check whether a row (1,4) belongs to it, how can I check that?</p>
  
  <p>My actual case involves comparison of 27 parameter values. Is there a solution in which I can do this without typing each and every parameter name? Thanks!</p>
  
  <p>The reason I want to do this is that I have an R dataset called <code>masterdata</code> which contains simulation data. I want to update this data set with new data that is obtained as I make additional simulation runs with different parameter combinations. It is possible, however, that I may forget that I have run the simulation for a certain parameter combination and may run it again, in which case, the <code>masterdata</code> will be expanded with duplicate values. I can later go and remove these duplicate values, but I would not want the whole process of updating the data set to go through if the values are duplicate. For this I need to check if the data from a simulation run is already present in the <code>masterdata</code>. I can do this if I know how to check whether a given row belongs to the <code>masterdata</code>.  </p>
  
  <p>Thanks.</p>