# NOT RUN {
# Load data
data("berlin")
# Inputs are data frames
# Travel time matrix
distA <- osrmTable(loc = apotheke.df[1:50, c("id","lon","lat")])
# First 5 rows and columns
distA$durations[1:5,1:5]
# Travel time matrix with different sets of origins and destinations
distA2 <- osrmTable(src = apotheke.df[1:10,c("id","lon","lat")],
dst = apotheke.df[11:20,c("id","lon","lat")])
# First 5 rows and columns
distA2$durations[1:5,1:5]
# Inputs are SpatialPointsDataFrames
distA3 <- osrmTable(loc = apotheke.sp[1:10,])
# First 5 rows and columns
distA3$durations[1:5,1:5]
# Travel time matrix with different sets of origins and destinations
distA4 <- osrmTable(src = apotheke.sp[1:10,], dst = apotheke.sp[11:20,])
# First 5 rows and columns
distA4$durations[1:5,1:5]
# }
Run the code above in your browser using DataLab