od_coordinates | R Documentation |
This function takes a wide range of input data types (spatial lines, points or text strings) and returns a data frame of coordinates representing origin (ox, oy) and destination (dx, dy) points.
od_coordinates(x, p = NULL, pd = NULL, silent = TRUE, sfnames = FALSE)
x |
A data frame in which the first two columns are codes representing points/zones of origin and destination |
p |
Points representing origins and destinations |
pd |
Points representing destinations, if different from origin points |
silent |
Hide messages? |
sfnames |
Should output column names be compatible with the sf package? |
A data frame with origin and destination coordinates
x = od_data_df p = od_data_centroids res = od_coordinates(x, p)[1:2, ] class(res) res od_coordinates(x, p, sfnames = TRUE)[1:2, ] od_coordinates(x, p, silent = FALSE)[1:2, ] od_coordinates(x, p) x = od_data_df2[1:3, ] p = od_data_centroids2 pd = od_data_destinations od_coordinates(x, p, pd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.