title: rolling average to multiple variables in R using data.table package
body: <p>I would like to get rolling average for each of the numeric variables that I have. Using data.table package, I know how to compute for a single variable. But how should I revise the code so it can process multiple variables at a time rather than revising the variable name and repeat this procedure for several times? Thanks.</p>
  
  <p>Suppose I have other numeric variables named as "V2", "V3", and "V4".</p>
  
  <pre><code>require(data.table)
  setDT(data)
  setkey(data,Receptor,date)
  data[ , `:=` ('RollConc' = rollmean(AvgConc, 48, align="left", na.pad=TRUE)) , by=Receptor]
  </code></pre>
  
  <p>A copy of my sample data can be found at:
  <a href="https://drive.google.com/file/d/0B86_a8ltyoL3OE9KTUstYmRRbFk/view?usp=sharing" rel="noreferrer">https://drive.google.com/file/d/0B86_a8ltyoL3OE9KTUstYmRRbFk/view?usp=sharing</a></p>
  
  <p>I would like to get 5-hour rolling means for "AvgConc","TotDep","DryDep", and "WetDep" by each receptor.</p>