Re: [R] only actual variable names in all.names()

2010-03-04 Thread Henrique Dallazuanna
Try this: all.vars(substitute(y ~ poly(x, k) + z, list(k = NA))) Or if you don't want substitute the var k: gsub(".*\\((.*),.*", "\\1", rownames(attr(terms(y ~ poly(x, k) + z), 'factors'))) On Thu, Mar 4, 2010 at 6:57 AM, Vito Muggeo (UniPa) wrote: > dear all, > When I use all.vars(), I am in

[R] only actual variable names in all.names()

2010-03-04 Thread Vito Muggeo (UniPa)
dear all, When I use all.vars(), I am interest in extracting only the variable names.. Here a simple example all.vars(as.formula(y~poly(x,k)+z)) returns [1] "y" "x" "k" "z" and I would like to obtain "y" "x" "z" Where is the trick? many thanks vito -- Vi