knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
Calculate pair-wise distances between all pairs of bicycle hire docking stations
represented in the bikedata
package,
by routing using the dodgr
package through
the corresponding OpenStreetMap street networks extracted using the
osmdata
package.
You can install streetdists from github with:
# install.packages("devtools") devtools::install_github("mpadge/streetdists")
Extract a single street network for London, New York, Chicago, Philadelphia, Washington DC, Boston, or Los Angeles (respectively "ny", "ch", "ph", "dc", "bo", and "la") like this:
net <- get_streetnet ("ny")
Or save all to disk with
get_all_networks ()
Street networks are returned as simple data.frame
objects of a form ready to
submit to dodgr
routines for calculating
distances. See the dodgr
vignette for more
information.
options(width=120)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.