1.添加列名

wts=c(1,1,1)

names(wts)=c("setosa","versicolor","virginica")

2.为矩阵添加列名和行名

wts=matrix(0,3,4)

row=c("row1","row2","row3")

column=c("setosa","versicolor","virginica")

dimnames(wts)=list(row,column)

 程序猿必读

posted on 2015-02-28 13:02  龙种人  阅读(35735)  评论(0编辑  收藏  举报