title: Extract characters from a column and create new variable
body: <p>I have a column with character strings which I want to extract and create a new  column. I want to extract o3,no2,nox, pm10, pm25 and coarse from the first column. Additionally I want to extract the second last digit from the same column. What I want to have is shown under column lag and polut in the sample data    </p>
  
  <pre><code>structure(list(pollutant = structure(c(4L, 2L, 3L, 5L, 6L, 1L, 
  5L), .Label = c("Lag(coarse10, 6)", "Lag(no210, 0)", "Lag(nox10, 0)", 
  "Lag(o3T10, 0)", "Lag(pm1010, 1)", "Lag(pm2510, 4)"), class = "factor"), 
      Estimate = c(0.0043156, -0.0049645, -0.0010619, -0.0070243, 
      -0.009382, -0.0017919, -0.0070243), lag = c(0L, 0L, 0L, 1L, 
      4L, 6L, 1L), pollut = structure(c(4L, 2L, 3L, 5L, 6L, 1L, 
      5L), .Label = c("coarse", "no2", "nox", "o3", "pm10", "pm25"
      ), class = "factor")), .Names = c("pollutant", "Estimate", 
  "lag", "pollut"), row.names = c(NA, -7L), class = "data.frame")
  </code></pre>