title: Subtracting a xts object from a subset of xts object
body: <pre><code>con = gzcon(url('http://www.systematicportfolio.com/sit.gz', 'rb'))
  source(con)
  close(con)
  load.packages("TTR,PerformanceAnalytics,quantmod,lattice")
  
  #######################################################
  #Get and Prep Data
  #######################################################
  data &lt;- new.env()
  tickers&lt;-spl("VTI,IEF,TLT,DBC,VNQ,GLD")
  
  getSymbols(tickers, src = 'yahoo', from = '1980-01-01', env = data)
  for(i in ls(data)) data[[i]] = adjustOHLC(data[[i]], use.Adjusted=TRUE)
  
  bt.prep(data, align='remove.na', dates='1990::2013')
  </code></pre>
  
  <p>I am experiencing the problem of subtracting a specific column from a xts object.</p>
  
  <pre><code>prices = data$prices
  ret = prices / mlag(prices) - 1
  ret - ret[,3]  #subtract column three from every other column don't seem to work
  </code></pre>
  
  <p>Is there a quick solution?</p>
  
  <p>I tried:</p>
  
  <pre><code>apply(ret,2,function(x) x - x[,3]) #doesn't seem to work
  </code></pre>
  
  <p>Any ideas?</p>