title: How to simplify the codes of a list in one line in R?
body: <p>I have a list of microarray platform text files containing of Gene Symbol accessions. I trim Gene Symbols with below codes. </p>
  
  <pre><code>p[[1]]&lt;- data.frame(sapply(p[[1]], function(x) sub("/.*", "", x)))
  p[[1]]&lt;- data.frame(sapply(p[[1]], function(x) sub("-.*", "", x)))
  p[[1]]&lt;- data.frame(sapply(p[[1]], function(x) sub("\\..*", "", x)))
  p[[1]]&lt;- data.frame(sapply(p[[1]], function(x) sub("\\s", "", x)))
  p[[2]]&lt;- data.frame(sapply(p[[2]], function(x) sub("/.*", "", x)))
  p[[2]]&lt;- data.frame(sapply(p[[2]], function(x) sub("-.*", "", x)))
  p[[2]]&lt;- data.frame(sapply(p[[2]], function(x) sub("\\..*", "", x)))
  p[[2]]&lt;- data.frame(sapply(p[[2]], function(x) sub("\\s", "", x)))
  </code></pre>
  
  <p>How can I simplify these codes in two lines?
  Thank so much for any idea.</p>