Learn R Programming

trafficCAR (version 0.1.0)

prep_travel_time: Prepare travel time outcome for Gaussian modeling

Description

Common choice is log(travel_time). If `distance` is provided, you can optionally model time-per-distance.

Usage

prep_travel_time(
  travel_time,
  distance = NULL,
  per_distance = FALSE,
  transform = c("log", "identity"),
  eps = 1e-06
)

Value

list with y (transformed), meta (transform info).

Arguments

travel_time

numeric vector (e.g., seconds).

distance

optional numeric vector of same length (e.g., meters).

per_distance

logical; if TRUE and distance provided, model travel_time / distance.

transform

character; currently supports "log" or "identity".

eps

small positive constant added before log to avoid log(0).