Skip to content
Back to formatted view

Raw Message

Message-ID: <644e1f320812281201x9b8d415hd7ca6e025539568e@mail.gmail.com>
Date: 2008-12-28T20:01:31Z
From: jim holtman
Subject: naming rows and columns in a matrix
In-Reply-To: <163684.18366.qm@web63903.mail.re1.yahoo.com>

?rownames
?colnames

> x <- matrix(nrow=7, ncol=3)
> rownames(x) <- paste('name', 1:7)
> rownames(x)
[1] "name 1" "name 2" "name 3" "name 4" "name 5" "name 6" "name 7"
>


On Sun, Dec 28, 2008 at 12:43 PM, Math Girl <mathmathgurl at yahoo.com> wrote:
> Hello,
>
> I have a 3 x 7 matrix.  I want to assign a name to each row
> and each column.  I tried using
> dimnames, but for some reason I cannot retrieve the names of the rows or the names
> of the columns.  Is there another way to name the rows and columns and refer to them?
>
>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?