[R] assign colnames to data

Henrique Dallazuanna wwwhsd at gmail.com
Mon Mar 15 20:57:57 CET 2010


Try:

names(a) <- b


On Mon, Mar 15, 2010 at 4:55 PM, Xumin Zeng <xumin.zeng at abbott.com> wrote:
> Hi,
>
> Do you know how to assign colnames from one list to another, for example.
> a=c(1,2,3)
> b=c("A","B","C")
>
> how can I get the dataset
>
> A B C
> 1  2 3
>
> where A, B and C are colnames. Thanks.
>
> Xumin
>
>        [[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.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O



More information about the R-help mailing list