Dear BioStars,

I have a genomic ranges (GR) list object called `lgr.test` and would like to simply add several columns to its metadata. How would I do that? I have a list of numeric vectors `lvec.test` of the same lengths as the GRs in `lgr.test`.

Thank you!

    > summary(lvec.test)
          Length Class  Mode   
    chr1  589    -none- numeric
    chr2  790    -none- numeric
    chr3  482    -none- numeric
    chr4  681    -none- numeric
    chr5  698    -none- numeric
    chr6  492    -none- numeric
    chr7  713    -none- numeric
    chr8  489    -none- numeric
    chr9  590    -none- numeric
    chr10 521    -none- numeric
    chr11 853    -none- numeric
    chr12 395    -none- numeric
    chr13 373    -none- numeric
    chr14 358    -none- numeric
    chr15 388    -none- numeric
    chr16 340    -none- numeric
    chr17 465    -none- numeric
    chr18 287    -none- numeric
    chr19 357    -none- numeric
    
    > summary(lgr.test)
          Length Class   Mode
    chr1  589    GRanges S4  
    chr2  790    GRanges S4  
    chr3  482    GRanges S4  
    chr4  681    GRanges S4  
    chr5  698    GRanges S4  
    chr6  492    GRanges S4  
    chr7  713    GRanges S4  
    chr8  489    GRanges S4  
    chr9  590    GRanges S4  
    chr10 521    GRanges S4  
    chr11 853    GRanges S4  
    chr12 395    GRanges S4  
    chr13 373    GRanges S4  
    chr14 358    GRanges S4  
    chr15 388    GRanges S4  
    chr16 340    GRanges S4  
    chr17 465    GRanges S4  
    chr18 287    GRanges S4  
    chr19 357    GRanges S4
<p>Ok, a <code>for</code> loop works (see below), but if some GR gurus see this, please save me from my ignorance and tell me how to do this using standard GR functions (<code>Map , endoapply, mendoapply, Reduce</code>). The <code>for </code>solution is fast enough but doesn&#39;t use the names of the objects in the lists, so it depends entirely on their order.</p>

<p>Cheers!</p>

<p><code>For</code> solution:</p>

<p><code>for (i in 1:length(lgr.test)) { values(lgr.test[[i]])$NEW&lt;-lvec.test[[i]] }</code></p>
