Hi,
when I pick out one element from a matrix, the attribute name is kept, but when
more than one elements are extracted, the attribute name lost;
 
>a<-matrix(c(1,2,3,11,12,13,45,56,76),ncol=3,dimnames=list(c(),c("c1","c2","c3")))
> k<-a[a[,"c3"]>50,"c3"]
> kk<-a[a[,"c3"]>60,"c3"]
> attributes(k)
NULL
> attributes(kk)
$names
[1] "c3"
 
 
YU


      
        [[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