[R] Extracting variables from random effects formulas

Rebecca Sela rsela at stern.nyu.edu
Thu May 29 06:24:38 CEST 2008


I would like to be able to extract the names of the variables in a formula that specifies random effects.  For example, given:
random = ~ 1+year | st_name
I'd like to be able to get "year" and "st_name" out of random.  Neither terms(random) nor random[2] seems to work.  Is there a way to get variable names out?

Thanks in advance!

Rebecca



More information about the R-help mailing list