- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 R“ map ”包按县制作美国的热图/等值线/专题图。不幸的是,数据库中似乎缺少一些县。
library(maps)
data(county.fips)
which(county.fips[,1] == 35006)
which(county.fips[,2] == 'new mexico,cibola')
结果没有找到条目
> library(maps)
> data(county.fips)
> which(county.fips[,1] == 35006)
integer(0)
> which(county.fips[,2] == 'new mexico,cibola')
integer(0)
我知道这个 fips 代码存在! (http://en.wikipedia.org/wiki/Cibola_County,_New_Mexico http://en.wikipedia.org/wiki/List_of_counties_in_New_Mexico )
有人知道我怎样才能完成我的完整情节吗?所有我能找到的都列在这里:http://grokbase.com/t/r/r-sig-geo/0964515wmd/missing-county-in-maps
感谢您的帮助!
最佳答案
啊哈,问题不在于 map ,而在于 county.fips。 Cibola 县未出现在该数据集中,因此当我将我的数据{variable-to-plot,FIPS 代码}与列表匹配时,Cibola 总是缺失。
有一个显示 Cibola 县的解决方法...为不涉及 county.fips 数据集的县写一条明确的行。
countynames <- match(county.fips[,"fips"], mydatavector$fips)
cibola_value <- mydatavector[which(mydatavector$fips == 35006)]
m <- map("county")
map("county", countynames, col=rainbow(100)[mydatavector$var_to_plot], fill=TRUE, add=TRUE)
map("county", "new mexico,cibola", col=rainbow(100)[cibola_value], fill=TRUE, add=TRUE)
注意:我还发现 map 函数在绘制美国所有县时遇到问题,但如果我将调用分成 2 个集合,它就可以正常工作。
关于R map 包缺少县,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13941586/
我有国家、地区、县、城镇数据,目前我正在决定 2 种模式设计(如果有更好的,请告诉我)。 我首先想到的 国家 身份证 姓名 地区 身份证 国家/地区 姓名 县 身份证 地区编号 姓名 城镇 身份证 县
我有两个数据集 df_state 和 df_city。 df_state 有一个数值的总和(net_value_x)。 df_city 在城市级别对数值 (value_x) 进行了分割 这只是德克萨斯
我有一个美国邮政编码及其对应的州、市和县的数据库。它以平面文件的形式提供,我正在尝试规范化数据并准确找出哪些实体依赖于哪些实体。 我遇到的一个问题是,有些城市似乎存在于多个县。我的印象是,在美国,存在
他们使用什么流程或 API 在他们的网站上提供此功能?如果它太复杂而无法解释,请您朝着正确的方向努力,以便也能够提供此功能。谢谢。 最佳答案 研究地理编码、地理标记和 GIS http://en.wi
R新手在这里。 如果我第一次使用 map('state') , 那么我如何使用 map('county', ylim=..., xlim=...)但像这样抵消它: 现在,我正在使用 imagemagi
以下查询适用于一种分类法 SELECT * FROM bb_posts AS p LEFT JOIN bb_term_relationships AS r ON (p.ID = r.object_id
利用 Mike Bostocks 美国各县区 block :https://bl.ocks.org/mbostock/4122298 。 目标是创建一个鼠标移动函数,在事件期间鼠标移动将突出显示所有选
在我的 MVC 应用程序中,我想显示用户访问网站的国家/地区、地区和城市。我怎样才能获取它们? 最佳答案 有几种方法。一种是要求用户与远程服务器共享他的位置。 https://developer.mo
我是一名优秀的程序员,十分优秀!