title: Error in `.rowNamesDF<-`(x, value = value) : duplicate 'row.names' are not allowed. using reshape in R
body: <p>I have a DataFrame with 737 rows, a sample of data is as follows, I want to use reshape on my data. I get error as <code>Error in `.rowNamesDF&lt;-`(x, value =  value) :  duplicate 'row.names' are not allowed In addition: Warning message: non-unique values when setting 'row.names':</code></p>
  <p>It tells me that I have duplicate 'row.names', but also in my sample data set I have duplicates, and it gives me the answer correctly just on my whole data set, it produce this error, where is the problem?</p>
  <p>Note: the code below doesn't produce error on sample data that includes duplicates, but it does produce in whole data set.</p>
  <p>The whole data set can be found in link below:
  <a href="https://www.dropbox.com/s/1rxzvqszvl1vzb9/ccc.csv?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/1rxzvqszvl1vzb9/ccc.csv?dl=0</a></p>
  <pre><code>
  df &lt;- structure(list('User Name' = c(&quot;WolfelFigaro&quot;, &quot;WolfelFigaro&quot;,  &quot;DeEvolver247&quot;, &quot;DeEvolver247&quot;, &quot;Raymond46194270&quot;, &quot;Raymond46194270&quot;,  &quot;merapimanf&quot;),
                       part1 = c(&quot;bonglez&quot;, &quot;bonglez&quot;, &quot;bonglez&quot;, &quot;bonglez&quot;,  &quot;x&quot;, &quot;bonglez&quot;, &quot;9NewsQueensland&quot;),
                       part2 = c(&quot;bonglez&quot;, &quot;bonglez&quot;,  NA, &quot;xx&quot;, NA, NA, NA),
                       part3 = c(&quot;bonglez&quot;, &quot;bonglez&quot;, NA, NA,  NA, NA, NA)), 
                  class = &quot;data.frame&quot;, row.names = c(&quot;1&quot;, &quot;2&quot;, &quot;3&quot;,  &quot;4&quot;, &quot;5&quot;, &quot;6&quot;, &quot;7&quot;))
  
  
  df3&lt;-reshape(df,
                  direction = &quot;long&quot;,
                  varying = list(names(df)[2:4]),
                  v.names = &quot;Link&quot;,
                  idvar = c(&quot;user_name&quot;))
  
  
  </code></pre>
  <p>The code for whole dataset:</p>
  <pre><code>df2 = read.csv(&quot;ccc.csv&quot;) 
  
  
  row.names(df2)
  print(tbl_df(df2), n=737)
  df4&lt;-reshape(df2,
              direction = &quot;long&quot;,
              varying = list(names(df2)[2:4]),
              v.names = &quot;x&quot;,
              idvar = c(&quot;MENTION&quot;))
  
  df4[&quot;time&quot;] &lt;-NULL
  df4[&quot;user_name&quot;] &lt;-NULL
  df4[&quot;Row&quot;] &lt;-NULL
  row.names(df4) &lt;- NULL
  
  
  net1 &lt;- graph_from_data_frame(df4)
  relationsp = get.adjacency(net1, sparse = FALSE)             
  </code></pre>