On Fri, Mar 26, 2010 at 4:15 PM, Bert Gunter <gunter.ber...@gene.com> wrote:
> Is this, from the man page, relevant?
>
> "An empty index selects all values: this is most often used to replace all
> the entries but keep the attributes. "

 No, I think that means doing "x[]", and only in replacement:

> x=101:105
> attr(x,"foo")="Fnord"
> x
[1] 101 102 103 104 105
attr(,"foo")
[1] "Fnord"
> x[]
[1] 101 102 103 104 105
attr(,"foo")
[1] "Fnord"
> x[]=1:5
> x
[1] 1 2 3 4 5
attr(,"foo")
[1] "Fnord"

 as you see, I've replaced all the entries but kept the attributes.

 c(NA,NA,NA) is clearly not empty...

Barry

______________________________________________
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