ab_sf | R Documentation |
This function takes a path to a JSON file representing an A/B Street
scenario, or an R representation of the JSON in a list, and returns
an sf
object with the same structure as objects returned by
ab_scenario()
.
ab_sf(json)
json |
Character string or list representing a JSON file or list that has been read into R and converted to a data frame. |
Note: the departure time in seconds is divided by 10000 on conversion to represent seconds, which are easier to work with that 10,000th of a second units.
An sf
data frame representing travel behaviour scenarios
from, and which can be fed into, A/B Street. Contains the following
columns: person (the ID of each agent in the simulation),
departure (seconds after midnight of the travel starting),
mode (the mode of transport, being Walk
, Bike
, Transit
and Drive
),
purpose (what the trip was for, e.g. Work
), and
geometry (a linestring showing the start and end point of the trip/stage).
file_name = system.file("extdata/minimal_scenario2.json", package = "abstr") ab_sf(file_name) json = jsonlite::read_json(file_name, simplifyVector = TRUE) ab_sf(json)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.