修改R中列表的行索引

时间:2016-10-20 10:25:59

标签: r indexing

内容是一个列表。我使用rbind()在行方向绑定colNames和record1。但索引的内容行是colNames和record1。我希望他们是[1,] [2,]。有没有可以做到这一点的功能? rbind()函数如何获取行的索引? rbind()函数是否将参数名称作为索引? 谢谢!

> content <-rbind(colNames, record1)
> content
         [,1]   [,2]      [,3]  [,4]  [,5] 
colNames "Draw" "Runners" "Win" "2nd" "3rd"
record1  "1"    "14"      "4"   "0"   "0"  
         [,6]  [,7] [,8] [,9] [,10] [,11]
colNames "4th" "W%" "Q%" "P%" "F%"  ""   
record1  "1"   "29" "29" "29" "36"  ""

0 个答案:

没有答案