georoute: Find driving routes using online services

Description Usage Arguments Value Author(s) Examples

View source: R/Contributed.R

Description

Find transit routes using Google or Bing's API

Usage

1
2
3
4
5
georoute(x, verbose = FALSE, service = "bing", returntype = "all", ...)

## Default S3 method:
georoute(x, verbose = FALSE, service = "bing",
  returntype = "all", ...)

Arguments

x

A character vector of length>=2, where each element is a (starting, ending, or intermediate) waypoint, or a numeric matrix with columns c('lat','lon') where each row is a waypoint

verbose

Provide additional information

returntype

What information to return. Currently, the options are "all", "distance", "distanceUnit", "path", "time", and/or "timeUnit". Can be combined, as in returntype=c("time","distance").

service

API to use. Currently the only option is "bing"

...

Other items to pass along

Value

Route information (see the returntype argument)

Author(s)

Ari B. Friedman

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
georoute( c("3817 Spruce St, Philadelphia, PA 19104",
 "9000 Rockville Pike, Bethesda, Maryland 20892"), verbose=TRUE )
georoute( c("3817 Spruce St, Philadelphia, PA 19104",
 "Tulum, MX","9000 Rockville Pike, Bethesda, Maryland 20892"), returntype="distance" )
georoute( c("3817 Spruce St, Philadelphia, PA 19104",
 "9000 Rockville Pike, Bethesda, Maryland 20892"), verbose=TRUE, returntype="path" )
georoute( c("3817 Spruce St, Philadelphia, PA 19104",
 "9000 Rockville Pike, Bethesda, Maryland 20892"), verbose=TRUE, returntype="time" )
# Using lat/lon
xmat <- rbind(
 geocode( "3817 Spruce St, Philadelphia, PA 19104" ),
 geocode( "9000 Rockville Pike, Bethesda, Maryland 20892" )
)
colnames(xmat) <- c( 'lat', 'lon' )
georoute( xmat, verbose=TRUE, returntype = c("distance","distanceUnit") )

## End(Not run)

gsk3/taRifx.geo documentation built on May 17, 2019, 8:56 a.m.