Skip to content

Can't Destroy Dim Names

3 messages · Gundala Viswanath, jim holtman, Greg Snow

#
Dear all,

I have the following matrix:
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:
Named chr [1:32268] "yQAAA" "jQAAQ" "UQAAg" "FQAAw" "1QABA" ...


But why this command fail to do it?
Btw, the object size for keeping matrix with dim names is greater
than without, right?



- Gundala Viswanath
Jakarta - Indonesia
#
Is this what you want:
Named num [1:3] 1 2 3
 - attr(*, "names")= chr [1:3] "a" "b" "c"
[1] 1 2 3

        
On Mon, Jan 12, 2009 at 8:32 PM, Gundala Viswanath <gundalav at gmail.com> wrote:

  
    
#
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,