title: Can I use gsub() on each element of a data frame?
body: <p>After importing a table from Wikipedia, I have a list of values of the following form:</p>
  
  <pre><code>    &gt; tbl[2:6]
      $`Internet
      Explorer`
       [1] "30.71%" "30.78%" "31.23%" "32.08%" "32.70%" "32.85%" "32.04%" "32.31%" "32.12%" "34.07%" "34.81%"
      [12] "35.75%" "37.45%" "38.65%" "40.63%" "40.18%" "41.66%" "41.89%" "42.45%" "43.58%" "43.87%" "44.52%"
  
      $Chrome
       [1] "36.52%" "36.42%" "35.72%" "34.77%" "34.21%" "33.59%" "33.81%" "32.76%" "32.43%" "31.23%" "30.87%"
      [12] "29.84%" "28.40%" "27.27%" "25.69%" "25.00%" "23.61%" "23.16%" "22.14%" "20.65%" "19.36%" "18.29%"
  </code></pre>
  
  <p>I am trying to get rid of the percentage signs, in order to convert the data to numeric form.</p>
  
  <p><strong>Is there a quicker way to clean this data than going for a vectorization?</strong> My current code follows:</p>
  
  <pre><code>    data &lt;- lapply(tbl[2:6], FUN = function(x) as.numeric(gsub("%", "", x)))
  </code></pre>
  
  <p>The data eventually become a data frame, but I could not get <code>gsub</code> to work properly across all elements of a data frame. <strong>Is there a way to gsub() each element of a data frame?</strong></p>
  
  <p><a href="http://rpubs.com/briatte/browsers" rel="noreferrer">The code for the project is online, with results.</a> Thanks in advance!</p>