title: How to add column to multiple data frames based on information from another data frame
body: <p>Apologies if this question is simple/been answered elsewhere - I have looked but as a newbie I can't seem to find what I need. </p>
  
  <p>I have a data frame (Length) which contains a a unique value which I need to add to different files  </p>
  
  <pre><code>View(Length)
          File_name                                                 Transcript_length                                                                 &lt;d
      1 sample15.fasta.out_alternative.out_contig.copynumber.csv          89229486
      2 sample16.fasta.out_alternative.out_contig.copynumber.csv          70908644
      3 sample2.fasta.out_alternative.out_contig.copynumber.csv           56017470
      4 sample28.fasta.out_alternative.out_contig.copynumber.csv          94888762
      5 sample30.fasta.out_alternative.out_contig.copynumber.csv         106260465
      6 sample31.fasta.out_alternative.out_contig.copynumber.csv          91189772
  </code></pre>
  
  <p>I have then imported and began to manipulate these copy.number.csv files but need to add a new column which contains the value corresponding to the file name?</p>
  
  <p>Attempt 1:</p>
  
  <pre><code>  #import copynumber data
  import2 &lt;- list.files(pattern="*copynumber.csv", full.names = TRUE)
  list2env(
    lapply(setNames(import2, make.names(gsub("$", "", import))),
           read.csv, sep = ""),
    envir = .GlobalEnv)
  CN_files &lt;- lapply(import2, read.csv, sep = "")
  names(CN_files) &lt;- gsub("$", "", import2)
  
  #then manipulate 
  for (f in 1:length(CN_files)) {
  
    names(CN_files[[f]]) &lt;- c("Family", "Element", "Length", "Fragments", "Copies", "Solo_LTR", "Total_Bp", "Cover") 
  </code></pre>
  
  <p>how do I then add the transcript length values to a new column based on the specific copynumber.csv file provided by the earlier data frame?</p>
  
  <p>Any help greatly appreciated, again, I am new to this, so feel free to give more general advice on how to  word a R question etc</p>