If you want a character representation of a long formula (or

a formula with long names), you can use:

 

as.character(my.formula)

 

However restriction on length of an as.character result

returns only the beginning of a long formula, and without comment.

 

In most cases, the following expression provides the complete

result:

 

paste(my.formula[[2]], "  ~ ", paste(attr(terms(my.formula),
"term.labels"),collapse= " + "),sep="")

 

It would be better to make as.character handle any size formula.


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
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