[R] extract data from a data.frame

Ian Garcia tazapa at yahoo.com
Tue Jan 13 00:49:16 CET 2004


 Hi,

 I'm reading part of a table from postgres, so I'm
getting a data frame. 

 how can I extract the numerica values so I can 
 operate on them.

> res <- dbGetResult(mydata)
> str(res)
`data.frame':   5 obs. of  8 variables:
 $ cyx.1: num   0.149 -0.278  0.114  0.060  0.109
 $ cyx.2: num   0.158 -0.070  0.063  0.149  0.150
 $ cyx.3: num   0.052 -0.350  0.114  0.126  0.238
 $ cyx.4: num   0.085 -0.009  0.097  0.121  0.258
 $ cyx.5: num   0.131 -0.028  0.068 -0.106  0.029
 $ cyx.6: num   0.140 -0.090  0.242 -0.071  0.713
 $ cyx.7: num   0.741 -0.290  0.215 -0.556  0.979
 $ cyx.8: num   0.129  0.043  0.287  0.1945 0.0265

 Thanks

 Ian




More information about the R-help mailing list