Hi,
Here are two options. Depending whether the data is already read in
or being created, one or the other may be more useful to you
###
x1 <- matrix(1:4, ncol = 2)
colnames(x1) <- c("First", "Second")
#OR
x2 <- matrix(1:4, ncol = 2, dimnames = list(NULL, c("First", "Second")))
x1
x2
###
Take a look at
?colnames
HTH,
Jorge
On Tue, Aug 17, 2010 at 9:08 PM, R Newbie wrote:
> Does anyone know how to assign (column names only) to a matrix?
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE
Does anyone know how to assign (column names only) to a matrix?
__
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,
3 matches
Mail list logo