[R] naming rows and columns in a matrix
jholtman at gmail.com
Sun Dec 28 21:01:31 CET 2008
> x <- matrix(nrow=7, ncol=3)
> rownames(x) <- paste('name', 1:7)
 "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:
> 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
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
+1 513 646 9390
What is the problem that you are trying to solve?
More information about the R-help