2017-07-14 20 views
1

Rで郡レベルのchoroplethマップをカスタムの色スケールでフォーマットする方法を理解してもらえますか?私はアラスカとハワイを正しく更新する方法を理解できません。Rの中点を持つChoroplethr地図

私はこれを試してみました:

library(choroplethr) 
library(ggplot2) 
data("df_county_demographics") 
df_county_demographics$value<-df_county_demographics$per_capita_income 

county_choropleth(df_county_demographics,num_colors = 
1)+scale_fill_gradient2("Score", low = "red", mid = "white", high = 
"green", midpoint = 20000, na.value = "grey90", label = 
scales::dollar_format()) 

これは私がそれをしたいどのように米国本土を更新しますが、ないアラスカやハワイ。

答えて

0

これを行うには、choroplethrのオブジェクト指向の機能を使用する必要があります。私はchoroplethrのドキュメントのthisの "Advanced Options"セクションでそれを行う方法を説明します。

関連する問題