## Not run:
# # Load data
# data("com")
#
# # Inputs are data frames
# # Travel time matrix
# distCom <- osrmTable(loc = com[1:50, c("comm_id","lon","lat")])
# # First 5 rows and columns
# distCom$durations[1:5,1:5]
#
# # Travel time matrix with different sets of origins and destinations
# distCom2 <- osrmTable(src = com[1:10,c("comm_id","lon","lat")],
# dst = com[11:20,c("comm_id","lon","lat")])
# # First 5 rows and columns
# distCom2$durations[1:5,1:5]
#
#
# # Inputs are SpatialPointsDataFrames
# distCom <- osrmTable(loc = src)
# # First 5 rows and columns
# distCom$durations[1:5,1:5]
#
# # Travel time matrix with different sets of origins and destinations
# distCom2 <- osrmTable(src = src, dst = dst)
# # First 5 rows and columns
# distCom2$durations[1:5,1:5]
# ## End(Not run)
Run the code above in your browser using DataLab