otp_connect: Set up and confirm a connection to an OTP instance.

Description Usage Arguments Value Examples

View source: R/otp-connect.R

Description

Defines the parameters required to connect to a router on an OTP instance and, if required, confirms that the instance and router are queryable.

Usage

1
2
3
4
5
6
7
8
otp_connect(
  hostname = "localhost",
  router = "default",
  port = 8080,
  tz = Sys.timezone(),
  ssl = FALSE,
  check = TRUE
)

Arguments

hostname

A string, e.g. "ec2-34-217-73-26.us-west-2.compute.amazonaws.com". Optional, default is "localhost".

router

A string, e.g. "UK2018". Optional, default is "default". Do not specify for OTPv2 which does not support named routers.

port

A positive integer. Optional, default is 8080.

tz

A string, containing the time zone of the router's graph. Optional. This should be a valid time zone (checked against vector returned by 'OlsonNames()'). For example: "Europe/Berlin". Default is the timezone of the current system (obtained from Sys.timezone()). Using the default will be ok if the current system time zone is the same as the time zone of the OTP graph.

ssl

Logical, indicates whether to use https. Optional, default is FALSE.

check

Deprecated and has no effect.

Value

Returns S3 object of class otpconnect if reachable.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
otpcon <- otpr_connect()
otpcon <- otpr_connect(router = "UK2018",
                      ssl = TRUE)
otpcon <- otpr_connect(hostname = "ec2.us-west-2.compute.amazonaws.com",
                      router = "UK2018",
                      port = 8888,
                      ssl = TRUE)

## End(Not run)

otpr documentation built on Jan. 7, 2022, 5:26 p.m.