powered by
Uses SAKBE API to return a route between two destiny id's considering the given parameters.
inegi_route(from, to, token, pref, vehicle, calc_cost = FALSE, rawJSON = FALSE)
Destiny id from where the route begins
Destiny id of end of route
Sakbe API token supplied by INEGI
Preference for road: 1 = with tolls (cuota), 2 = without tolls (libre), 2 = suggested route
Vehicle choice: 0 = motorcycle, 1 = auto, 2 = two axis bus, 3 = three axis bus, 4 = four axis bus, 5 = two axis truck, 6 = three axis truck, 7 = four axis truck, 8 = five axis truck, 9 = six axis truck, 10 = seven axis truck, 11 = eight axis truck, 12 = nine axis truck.
if TRUE will use the price of gasoline to calculate total cost of trip. Very experimental, defaults to FALSE.
if TRUE returns only the JSON data, not parsed
list
See the official API here: http://www.inegi.org.mx/desarrolladores/sakbe/apisakbe.aspx
# NOT RUN { # Macroplaza in Monterrey to Mexico City airport. # } # NOT RUN { token <- "webservice_token" route <- inegi_route(from = 6940, to = 57, token, pref = 2, vehicle = 1) # }
Run the code above in your browser using DataLab