matrix and table names / dimnames

て烟熏妆下的殇ゞ 提交于 2019-12-01 00:48:59

You need to set the attribute of the object to be a list of proper length.

attr(mat, "dimnames") <- list(Gender = c("Male", "Female"), 
                              munic = c("mun_5","mun_1","mun_2","mun_3","mun_4","mun_6","mun_7","mun_8","mun_9","mun_10","mun_11"))

> mat
        munic
Gender    mun_5  mun_1  mun_2  mun_3  mun_4  mun_6  mun_7  mun_8  mun_9 mun_10 mun_11
  Male   148470  22829  26137  49613  48337  19492  27406  25487  48349  44335  35814
  Female  24721  24777  43169  40406  34296 176712  23010  27064  52140  50908  18825
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!