title: Merge two columns in R present within a same data.frame without any conditions and finding unique values
body: <p>I have a data.frame df as mentioned below</p>
  
  <pre><code>    V1 V2
  4   b  c
  14  g  h
  10  d  g
  6   b  f
  2   a  e
  5   b  e
  12  e  f
  1   a  b
  3   a  f
  9   c  h
  11  d  h
  7   c  d
  8   c  g
  13  f  g
  </code></pre>
  
  <p>The first column is the row.names column so just ignore that. Now see the second columns V1 and V2. I want to find unique elements present in the columns V1 and V2. So if you see V1 the unique elements are b,g,d,a,e,c,f and in V2 the unique elements are c,h,g,f,e,b,d. Now if you look in these unique elements listed above. Even come elements are common in V1 and V2 i.e b,g,d,a,e,c and f. </p>
  
  <p>So i need to make a new data.frame which has one column which lists all unique elements considering both V1 and V2. By unique elements i mean elements which are either present in V1 or in V2 or in both but they should not be listed repeatedly in this new data.frame so the data.frame i want is listed below. It would be better if the list is sorted alphabetically (if values are alphabets like a,b,c,d... or in ascending order if elements are 1,2,3,..</p>
  
  <pre><code>UniqueValues
  a
  b
  c
  d
  e
  f
  g
  h
  </code></pre>
  
  <p>Suppose this new data.frame is called UV1 and i have a similar data.frame with one column with the number of rows being either same or greater or lesser and is called UV2(and is a result of a similar operation between other columns of a different data.frame like above), so can i compare these 2 data.frames i.e compare UV1 and UV2 and find values which are same in both these data.frames and values which are not same in both these data.frames and save them in 2 different data.frames like in a (similarValuesdf) and in a (differentValuesdf) data.frames? </p>
  
  <p>I am a beginner so i would prefer easier code rather than 5-10 operations being performed in a single statements like i have seen in other replies. I understand that is for time saving and those pros would have gone through a lot to figure out that one two lines of code to perform the whole thing but I am just trying to learn so would really appreciate easier code. 
  Thanks in advance.</p>