# NOT RUN {
dat = data.frame(name = regionNames("china"),
value = runif(34))
geojsonMap(dat,"china")
dat$value2 = cut(dat$value, c(0, 0.25, 0.5, 1))
geojsonMap(dat,"china",
namevar = ~name,
valuevar = ~value2,
palette="Reds",
colorMethod="factor")
geojsonMap(dat,"china",
namevar = ~name,
valuevar = ~value2,
palette = topo.colors(3),
colorMethod="factor")
# }
Run the code above in your browser using DataLab