title: rownames on multiple dataframe with for loop in R
body: <p>I have several dataframe. I want the first column to be the name of each row.</p>
  <p>I can do it for 1 dataframe this way :</p>
  <pre><code># Rename the row according the value in the 1st column
  row.names(df1) &lt;- df1[,1]
  
  # Remove the 1st column
  df1 &lt;- df1[,-1]
  </code></pre>
  <p>But I want to do that on several dataframe. I tried several strategies, including with assign and some get, but with no success. Here the two main ways I've tried :</p>
  <pre><code># Getting a list of all my dataframes
  my_df &lt;- list.files(path=&quot;data&quot;)
  
  # 1st strategy, adapting what works for 1 dataframe
  for (i in 1:length(files_names)) {
    rownames(get(my_df[i])) &lt;- get(my_df[[i]])[,1] # The problem seems to be in this line
    my_df[i] &lt;- my_df[i][,-1]
  }
  
  # The error is  Could not find function 'get&gt;-'
  
  # 2nd strategy using assign()
  for (i in 1:length(my_df)) {
    assign(rownames(get(my_df[[i]])), get(my_df[[i]])[,1]) # The problem seems to be in this line
    my_df[i] &lt;- my_df[i][,-1]
  }
  
  # The error is : Error in assign(rownames(my_df[i]), get(my_df[[i]])[, 1]) : first argument incorrect
  </code></pre>
  <p>I really don't see what I missed. When I type <code>get(my_df[i])</code> and <code>get(my_df[[i]])[,1]</code>, it works alone in the console...</p>
  <p>Thank you very much to those who can help me :)</p>