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)
程序猿必读