Your mat variable is not a matrix, but a vector (a named vector), therefore it 
does not have dimensions or dimnames.

Try names(mat) <- NULL

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


> -----Original Message-----
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of Gundala Viswanath
> Sent: Monday, January 12, 2009 6:32 PM
> To: r-h...@stat.math.ethz.ch
> Subject: [R] Can't Destroy Dim Names
> 
> Dear all,
> 
> I have the following matrix:
> 
> > str(mat)
> Named chr [1:32268] "yQAAA" "jQAAQ" "UQAAg" "FQAAw" "1QABA" ...
>  - attr(*, "names")= chr [1:32268] "CAAAAAAAAA" "CAAAAAAAAC"
> "CAAAAAAAAG" "CAAAAAAAAT" ...
> 
> 
> I want to destroy the attribute yielding only this:
> 
> > str(mat)
> Named chr [1:32268] "yQAAA" "jQAAQ" "UQAAg" "FQAAw" "1QABA" ...
> 
> 
> But why this command fail to do it?
> 
> > dimnames(mat) <- NULL
> 
> Btw, the object size for keeping matrix with dim names is greater
> than without, right?
> 
> 
> 
> - Gundala Viswanath
> Jakarta - Indonesia
> 
> ______________________________________________
> 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.

______________________________________________
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