title: R: access field values
body: <p>I would like to know how I can access the individual fields contained in an R object. Or, more precisely, how to get R to tell me how.</p>
  
  <p>For example, if I run the following code:</p>
  
  <pre><code>dx.ct &lt;- ur.df(dat1[,'dx'], lags=3, type='trend')
  summary(dx.ct)
  </code></pre>
  
  <p>then I get this output:</p>
  
  <pre><code>############################################### 
  # Augmented Dickey-Fuller Test Unit Root Test # 
  ############################################### 
  
  Test regression trend 
  
  
  Call:
  lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag)
  
  Residuals:
       Min       1Q   Median       3Q      Max 
  -0.46876 -0.24506  0.02420  0.15752  0.66688 
  
  Coefficients:
               Estimate Std. Error t value Pr(&gt;|t|)  
  (Intercept)  1.099231   0.561377   1.958   0.0606 .
  z.lag.1     -0.239438   0.141093  -1.697   0.1012  
  tt          -0.019831   0.007799  -2.543   0.0170 *
  z.diff.lag1 -0.306326   0.193001  -1.587   0.1241  
  z.diff.lag2 -0.214229   0.186135  -1.151   0.2599  
  z.diff.lag3 -0.223433   0.179040  -1.248   0.2228  
  ---
  Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 
  
  Residual standard error: 0.3131 on 27 degrees of freedom
  Multiple R-squared: 0.3326,     Adjusted R-squared: 0.209 
  F-statistic: 2.691 on 5 and 27 DF,  p-value: 0.04244 
  
  
  Value of test-statistic is: -1.697 2.4118 3.2358 
  
  Critical values for test statistics: 
        1pct  5pct 10pct
  tau3 -4.15 -3.50 -3.18
  phi2  7.02  5.13  4.31
  phi3  9.31  6.73  5.61
  </code></pre>
  
  <p>So, I know that I should be able to access all of the values above individually, I don't know how to point to them. Is there some way to ask R to show me how they are stored?</p>
  
  <p>I am thinking along the lines of:</p>
  
  <pre><code>showobjects(summary(dx.ct))
  </code></pre>
  
  <p>And then it outputs</p>
  
  <pre><code>$formula
  $residuals
  $coefficients
  etc.
  </code></pre>
  
  <p>and then I can do</p>
  
  <pre><code>showobjects(summary(dx.ct)$residuals)
  </code></pre>
  
  <p>which then outputs</p>
  
  <pre><code>$min
  $1Q
  $median
  etc.
  </code></pre>
  
  <p>Thanks<br>
  Karl</p>