View source: R/addWalkingPath.R
addWalkingPath | R Documentation |
Add the shortest walking path between a selected cases or pumps.
addWalkingPath(origin = 1, destination = NULL, type = "case-pump", observed = TRUE, weighted = TRUE, vestry = FALSE, distance.unit = "meter", time.unit = "second", walking.speed = 5, unit.posts = "distance", unit.interval = NULL, alpha.level = 1)
origin |
Numeric or Integer. Numeric ID of case or pump. |
destination |
Numeric or Integer. Numeric ID(s) of case(s) or pump(s). Exclusion is possible via negative selection (e.g., -7). Default is |
type |
Character "case-pump", "cases" or "pumps". |
observed |
Logical. Use observed or "simulated" expected data. |
weighted |
Logical. |
vestry |
Logical. |
distance.unit |
Character. Unit of distance: "meter", "yard" or "native". "native" returns the map's native scale. |
time.unit |
Character. "hour", "minute", or "second". |
walking.speed |
Numeric. Walking speed in km/hr. |
unit.posts |
Character. "distance" for mileposts; "time" for timeposts. |
unit.interval |
Numeric. Sets interval between posts: for "distance", the default is 50 meters; for "time", the default is 60 seconds. |
alpha.level |
Numeric. Alpha level transparency for path: a value in [0, 1]. |
An R list with two elements: a character vector of path nodes and a data frame summary.
The function uses a case's "address" (i.e., a stack's "anchor" case) to compute distance. Time is computed using cholera::distanceTime(). Adam and Eve Court, and Falconberg Court and Falconberg Mews, are disconnected from the larger road network; they form two isolated subgraphs. This has two consequences: first, only cases on Adam and Eve Court can reach pump 2 and those cases cannot reach any other pump; second, cases on Falconberg Court and Mews cannot reach any pump. Unreachable pumps will return distances of Inf
. Arrow points represent mileposts or timeposts to the destination.
streetNameLocator("broad street", zoom = TRUE, highlight = FALSE, add.subtitle = FALSE) addWalkingPath(447)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.