bbox <- get_bbox (c (-0.13, 51.5, -0.11, 51.52))
highways <- c ('Monmouth.St', 'Short.?s.Gardens', 'Endell.St', 'Long.Acre',
'Upper.Saint.Martin')
# Note that dots signify "anything", including whitespace and apostrophes, and
# that '?' denotes optional previous character and so here matches both
# "Shorts Gardens" and "Short's Gardens"
highways1 <- connect_highways (highways=highways, bbox=bbox, plot=TRUE)
highways <- c ('Endell.St', 'High.Holborn', 'Drury.Lane', 'Long.Acre')
highways2 <- connect_highways (highways=highways, bbox=bbox, plot=TRUE)
# These are also part of the 'london' data provided with 'osmplotr':
highways1 <- london$highways1
highways2 <- london$highways2
# Use of 'connect_highways' to highlight a region on a map
map <- plot_osm_basemap (bbox=bbox, bg='gray20')
# dat_B <- extract_osm_data (key='building', value='!residential', bbox=bbox)
# Those data are part of 'osmplotr':
dat_BNR <- london$dat_BNR # Non-residential buildings
groups <- list (london$highways1, london$highways2)
map <- add_osm_groups (map, obj=dat_BNR, groups=groups,
cols=c('red', 'blue'), bg='gray40')
print (map)Run the code above in your browser using DataLab