0
我對R上的地圖進行可視化並不是很新,我試圖改變運動中的傳奇。
我的代碼下在Highchart Choropleth中更改顏色軸
ds <- a21 %>%
group_by(fips) %>%
do(item = list(
fips = first(.$fips),
sequence = .$freq,
value = first(.$freq))) %>%
.$item
hc <- highchart(type = "map") %>%
hc_add_series(data = ds,
name = "complaints",
mapData = uscountygeojson,
joinBy = "fips",
borderWidth = 0.01) %>%
hc_colorAxis(stops = color_stops()) %>%
hc_title(text = "patient complaints") %>%
hc_legend(layout = "vertical", reversed = TRUE,
floating = TRUE, align = "right") %>%
hc_add_theme(hc_theme_smpl()) %>%
hc_motion(
enabled = TRUE,
axisLabel = "year",
labels = sort(unique(a21$year)),
series = 0,
updateIterval = 50,
magnet = list(
round = "floor",
step = 0.1
)
)
截圖:
截至目前我看到[R自動創建頻率colorbins
我想改變這我的數據框中的一組自定義值。
我的數據幀的一個片段是在
a21:
year fips freq q
1 2004 1001 3 1st Quantile
2 2005 1001 0 1st Quantile
3 2006 1001 4 1st Quantile
4 2007 1001 0 1st Quantile
5 2008 1001 0 1st Quantile
6 2009 1001 0 1st Quantile
我想q列的顏色軸標籤