# NOT RUN {
data(World, rivers, metro)
# just the map
qtm(World)
# choropleth
qtm(World, fill = "economy", format = "World", style = "col_blind")
# choropleth with more specifications
qtm(World, fill="HPI", fill.n = 9, fill.palette = "div",
fill.title = "Happy Planet Index", fill.id = "name",
style = "gray", format = "World")
# this map can also be created with the main plotting method,
# which is recommended in this case.
# }
# NOT RUN {
tm_shape(World) +
tm_polygons("HPI", n = 9, palette = "div",
title = "Happy Planet Index", id = "name") +
tm_style("gray") +
tm_format("World")
# }
# NOT RUN {
# bubble map
# }
# NOT RUN {
qtm(World, borders = NULL) +
qtm(metro, symbols.size = "pop2010",
symbols.title.size= "Metropolitan Areas",
symbols.id= "name",
format = "World")
# }
# NOT RUN {
# dot map
# }
# NOT RUN {
current.mode <- tmap_mode("view")
qtm(metro, bbox = "China")
tmap_mode(current.mode) # restore mode
# }
# NOT RUN {
# }
# NOT RUN {
# without arguments, a plain interactive map is shown (the mode is set to view)
qtm()
# search query for OpenStreetMap nominatim
qtm("Amsterdam")
# }
Run the code above in your browser using DataLab