星星图不准确

时间:2018-07-25 15:21:40

标签: r plot

我正在基于普查数据在R中创建一个星图,并具有用于普查区的行和用于种族的列。我想创建一个星图,其中包含每个人口普查区和各个种族的地块。

我已经成功制作了这个,但情节不正确。

Plot, note inaccurate Native American value

代码:

  

`ggpal <-hue_pal()(6)

     

Camtest [[4]] <-Camtest [[4]] / totalpop   starschart <-stars(Camtest [[4]],col.segments = ggpal,len = 1,key.loc = c(15,1),> ncol = 7,draw.segments = TRUE,标签=> as.character (row.names((Camtest [[4]]))),key.labels = colnames(Camtest [[4]]),cex> = .5)   图例('top',inset = c(0,-0.03),colnames(Camtest [[4]]),ncol = 3,fill = ggpal,cex = 0.6,bty ='n',x.intersp = 0.3)

     

starschart`

Camtest的数据[[4]]: “”,“白人”,“黑人或非裔美国人”,“美洲印第安人和阿拉斯加土著人”,“亚洲人”,“西班牙裔或拉丁裔” “ 352101”,661,69,0,595,339 “ 352102”,1540,120,0,452,248 “ 352200”,1176,236,8,105,113 “ 352300”,2011,143,0,996,518 “ 352400”,688,670,0,234,383 “ 352500”,1776,310,23,313,209 “ 352600”,1436,355,0,342,419 “ 352700”,1235,324,16,270,191 “ 352800”,1456,95,5,219,239 “ 352900”,2385,0,0,225,137 “ 353000”,2186,420,0,508,297 “ 353101”,1425,334,0,383,355 “ 353102”,2505,196,16,1313,444 “ 353200”,3131,401,0,871,426 “ 353300”,2663,222,0,414,185 “ 353400”,1430,675,50,328,305 “ 353500”,1600,454,0,318,107 “ 353600”,3315,280,7,528,429 “ 353700”,3741,213,7,1095,492 “ 353800”,3027,91,0,787,467 “ 353900”,3526,463,16,1321,685 “ 354000”,2866,126,15,735,292 “ 354100”,2224,71,0,273,136 “ 354200”,3063,17,0,176,111 “ 354300”,2169,307,0,480,175 “ 354400”,1444,45,0,89,112 “ 354500”,1834,41,4,95,122 “ 354600”,3130,1315,0,644,250 “ 354700”,2110,217,3,299,121 “ 354800”,1700,91,0,215,86 “ 354900”,2018,2174,16,1457,714 “ 355000”,2125,393,0,454,187

0 个答案:

没有答案