I am using terms.formula function to substract the variables from a formula 
environment.

Concretely, with the attr(*, "term.labels") I get the right side terms 
specified in the formula.

However, when introducing the same variable two or more times, this appears 
only once.

For example, when typing



>f <- y ~ cholesterol + age + age

>attr(terms(f),"term.labels")



I get



[1] "cholesterol" "age"



and I would like to get



[1] "cholesterol" "age" "age"





Is it possible with terms.formula function to obtain the variables and the 
times that they are specified in the formula? Or may I use another function?



Thanks in advance.



Isaac.


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to