[R] how to use attr?

Jeff D. Hamann jeff_hamann at hamanndonald.com
Tue Jan 8 20:54:50 CET 2002


I'm trying to build a flexible OLS/SUR/2SLS/3SLS package and I'm having
trouble getting some information out of a formula. For example....

# set up the system of equations
demand    <- q ~ p + d
supply    <- q ~ p + f + a
inst    <- ~ d + f + a
systemeq   <- list( demand, supply )

...blah, blah, blah...

# get the number if instruments...
# or build the "bigX"...
#I need to get a print of the variables to build a large matrix...
print( attr( systemeq[[1]], "variables" ) )

I've tried all kinds of variants...
names( systemeq[[1]] )
names( systemeq[[1]]$formula )

Jeff.

Jeff D. Hamann
Hamann, Donald & Associates, Inc.
PO Box 1421
Corvallis, Oregon USA 97339-1421
Bus. 541-753-7333
Cell. 541-740-5988
jeff_hamann at hamanndonald.com
www.hamanndonald.com


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list