title: How to add data to a vector in a apply function?
body: <p>I have an object like this:</p>
  
  <pre><code>str(sequ[1:2])
   $ gi|254574545|ref|XM_002494337.1|:Class 'SeqFastadna'  atomic [1:3288] a t g a ...
    .. ..- attr(*, "name")= chr "gi|254574545|ref|XM_002494337.1|"
    .. ..- attr(*, "Annot")= chr "gi|254574545|ref|XM_002494337.1| Pichia pastoris GS115 ER membrane protein involved in regulation of OLE1 transcription, acts w"| __truncated__
   $ gi|254574543|ref|XM_002494336.1|:Class 'SeqFastadna'  atomic [1:1614] a t g g ...
    .. ..- attr(*, "name")= chr "gi|254574543|ref|XM_002494336.1|"
    .. ..- attr(*, "Annot")= chr "gi|254574543|ref|XM_002494336.1| Pichia pastoris GS115 Subunit of the CCR4-NOT complex (PAS_FragD_0003) mRNA, complete cds"
  </code></pre>
  
  <p>How can I concatenate all the data of the names: <code>"gi|254574545|ref|XM_002494337.1|" "gi|254574543|ref|XM_002494336.1|"</code>?</p>
  
  <p>I do it like this:</p>
  
  <pre><code>library(seqinr)
  sequ = read.fasta(file="../pure_fasta_pichia.fasta", strip.desc = TRUE)
  seq_genome = c()
  for (i in 1:length(sequ)){ 
    seq_genome = c(seq_genome, sequ[[i]][1:length(sequ[[i]])])
  }
  </code></pre>
  
  <p>I am convinced that it can be done with lapply or similar.</p>
  
  <p>And I tried this:</p>
  
  <pre><code>seq_genome = c()
  seq_genome = lapply(sequ, function(x){seq_genome = c(seq_genome, x)})
  </code></pre>
  
  <p>I expected to have:</p>
  
  <pre><code>seq_genome 
   a t g a ... a t g g ...
  </code></pre>
  
  <p>My data is quite big (<code>&gt;length(sequ)  [1] 4903</code>) and each one is more than 200 elements, usually 3k of elements. That's why my computer crashed and I don't copy a <code>dput</code> here.</p>
  
  <p>How can I do it ? I think my function inside <code>lapply</code> is not right but I don't know how to improve it...</p>