I agree it may not be 100% clear but ?names does say
"The default methods get and set the '"names"' attribute 
of a vector or list." and if you issue the command:

methods("names")

you find that the only non-default method is names.dist.
 
Date: Sun, 21 Dec 2003 17:54:25 +0000 (GMT) 
From: Damon Wischik <[EMAIL PROTECTED]>
To: Gabor Grothendieck <[EMAIL PROTECTED]> 
Cc: <[EMAIL PROTECTED]> 
Subject: Re: [R] Factor names & levels 

 
 

> names() is only defined for vectors and lists and factors are
> neither. See ?vector and ?names for more info.

?vector tells me that factors are not vectors, but ?names does not tell me
that names() is only defined for vectors and lists. If it were, how
should I understand the following?

> x <- factor(c("one","three"))
> names(x) <- c("fred","jim")
> names(x)
[1] "fred" "jim" 
> class(x)
[1] "factor"

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to