title: Accessing objects of environment in R using quantmod library
body: <p>I have some experience in R but so far never used my own environment. Over the last months I had to use my own environment from time to time and I have some questions about it. </p>
  
  <ul>
  <li>The main reason for using an environment as "data-container" is
  because it is much faster then others, right? For example, using the
  <code>quantmod</code> why do we load OHLC objects into an environment by using
  <code>getSymbols</code>?</li>
  </ul>
  
  <p>Having such a new environment coming from <code>getSymbols</code>, i.e. </p>
  
  <pre><code>tick = c( "VNO" , "VMC" , "WMT" , "WAG") 
  data.env &lt;- new.env()    start&lt;-as.Date("2013-01-01")   
  getSymbols(tick,env=data.env,src="yahoo",from=start)
  </code></pre>
  
  <p>How can we efficiently access members in data.env, e.g. if we want to check if all members in data.env are OHLC objects can we do something like: <code>is.OHLC(data[[all elements]])</code>? </p>
  
  <p>Moreover, for the above examples of data, how can I calculate the Value at Risk for such a portfolio. My idea was to us the function <code>VaR</code> from the <code>PerformanceAnalytics</code> library. The help page of <code>VaR</code> says as argument: "an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns". For this purpose I wanted to use <code>dailyReturn</code> to get the returns, which then can be used for the function <code>VaR</code>. However <code>dailyReturn</code> needs an OHLC object as argument. Hence I can calculate <code>VaR</code> as soon as I know how to turn the elements in <code>data.env</code> to a OHLC matrix</p>