Learn R Programming

Basic contains cartools R package code, files and vignette.

Copy Link

Version

Install

install.packages('cartools')

Monthly Downloads

15

Version

0.1.0

License

MIT + file LICENSE

Maintainer

Paul Ossenbruggen

Last Published

August 20th, 2018

Functions in cartools (0.1.0)

accelpass

The accelpass function estimates the relative locations of two vehicles where one passes the other.
brkdelay

brkdelay is a wrapper function for brktrials2.
L

L is a matrix containing information about the lead vehicle. The bottleneck is located at x = 0.
QUKtdayX

I-93 data set
capacityplot

The function capacityplot creates a (k,Q*) plot indicating the success rate of sustaining capacity Q*
cfanim

cfanim uses a stochastic model of speed to describe driver's ability to maintain a speed u.
brkdelay3

brkdelay3 is a wrapper function for brktrials3.
findt2ab

t2 is the intersection point of the following driver sight-line and lead vehicle x trajectory. Lead vehicle location xl2 and speed ul2 at the intersection point, respectively.
brksummary

The function brksummary is a wrapper for accelpass and passplot.
findt5ab

The time t5 when the following vehicle reaches the bottleneck or location x = 0.
brktrials2

brktrials2 produces t-x trajectories for lead and following vehicles at a bottleneck
formqueue

The formqueue function is used to explain queuing upstream of a bottleneck.
f2

Headway h between the lead and following vehicles at time t. Lead and following vehicles use constant speed models, respectively.
findt1

findt1 returns the deceleration time t1, the location xf1, and speed uf1 of the following vehicle at time t1.
findt5

The time t5 when the following vehicle reaches the bottleneck or location x = 0.
brktrials3setup

brktrials3setup produces t-x trajectories for lead and following vehicles at a bottleneck
lanedf

lanedf returns a vector of vehicles veh in lane.
gbmtheta

Estimate theta of a geometric Brownian motion model.
h2

Space headway h2 at time t2, the time the following vehicle driver sees the lead vehicle has decelerated.
merge3

merge3 produces t-x trajectories for a pair of lead and following vehicles for brktrial3.
merge

merge produces t-x trajectories for a pair of lead and following vehicles.
bmfree2

The bmfree2 function returns a tux matrix of time t, speed u (fps) and location x (feet).
plotfollow3

plotfollow3 adds a new trajectory to an existing graph.
gbmx

Estimate distance x given a geometric Brownian motion model and time t.
leff

leff is the effective length of a vehicle.
passplot

The function passplot plots the data from brksummary, freeflowpass, decelmerge data frames.
trajectoryab3

trajectoryab3 fits a second-order velocity model and produces a t-x trajectory for vehicle = i where i = 3,4, ..., nveh.
trial

The function trial produces traffic performance information, stored in lists L and Fw for lead and following vehicles, respectively/ L and Fw contain the information needed to graph a time-distance t-x trajectories for two vehicles.
plotcrossover

A ggplot2 plot of crossover traffic data.
brkcross0

brkcross0 estimates the time, speed and location that a vehicle crosses bottleneck location x = 0.
plotlead

Produces a time-distance t-x trajectory for the lead vehicle, vehicle = 1.
findt1ab

The findt1ab returns the time tf1 and the location xf1 and speed uf1 of the following vehicle when the driver begins to decelerate.
findt2

findt2 returns the time t2 and xf2 when the following vehicle driver recognizes the lead vehicle has decelerated.
xab

Estimate distance x using second-order speed function.
animate_rr

animate_rr draws the path around the ring-road using data LF from rrtrials.
bmfree

The bmfree function returns a tux matrix of time t, speed u and location x values.
dfmanager

dfmanager is a wrapper function for brktrials2
xabmerge

xabmerge produces t-x trajectories for a pair of lead and following vehicles.
t0

t0 is the time the analysis is initiated.
hsafe

Safe headway h between lead and following vehicles. Speed u of lead vehicle is measured in fps.
plottux

plottux produces t-u and t-x trajectories for a lead and following vehicles on a ring road,
f1

Space headway h between the lead and following vehicles at time t. Lead and following vehicles use gbm and constant speed models, respectively.
xl3

The lead l vehicle location xl3 at time t3.
freeflowpass

The freeflowpass function estimates the relative locations of two vehicles where one passes the other.
xstart

xstart is a vector that designates the start x location for the brktrials function.
lane

lane is a vector that designates the lane drivers are traveling in the brktrials function.
gbm

Estimate speed u at time t using a geometric Brownian motion model.
h0

Space headway h0 at time t = 0.
plotdesire3

plotdesire3 creates t-x desire-line trajectories.
h1

Space headway h1 at time t1, the time the following vehicle initiates deceleration.
mergedemo

mergedemo produces t-x trajectories for a pair of lead and following vehicles.
h3

Space headway h3 at time t3, the time the lead vehicle has decelerated to breakdown speed u0.
t1

t1 is time the following vehicle realizes the lead vehicle is decelerating.
nopass

nopass produces t, u and x for lead and following vehicles downstream of a bottleneck
plotupstream

plotupstream produces t-x trajectories for lead and following vehicles at a bottleneck
safecrossover

The function safecrossover a graph showing driver conflict of two vehicles changing lanes.
schematic

The function schematic defines key features of a simple bottleneck
ul2

The following l vehicle speed ul2 at time t2.
rrtrials

rrtrials produces t-x trajectories for lead and following vehicles on a ring road
run

The run function is a wrapper for the trial and plotfollow3 functions.
lfmatrix

The function lfmatrix displays cflist, the lists L and Fw information for lead and following vehicles, respectively.
tuxvfix3

tuxvfix3 fixes hsafe violations for vehicle veh in matrix tuxv.
uab

Estimate distance u using second-order speed function.
uf3

The following f vehicle speed uf3 at time t0.
plotfollow

Produces a time-distance t-x trajectory for vehicle i = 2.
ul3

The following l vehicle speed ul3 at time t3.
uk_sdk

A speed volatility model.
rrheadway

rrheadway is a function to estimate the traffic flow q on a ring road.
xf2

The lead f vehicle location xf2 at time t2.
zipper

The zipper function can be used to simulate interaction among three vehicles in car following on a single lane or three vehicles merging on a two-lane highway.
rrheadwayu

rrheadwayu is a function used to find the speed u on a ring road at x = 0.
speedboxplot

The function speedboxplot plots the data from a data frame QUKtdayX
xf3

The lead f vehicle location xf3 at time t3.
speedplot

A scatter plot of traffic data.
xfollow

Estimate x distance traveled using a constant speed model.
logisticmodel

The function logisticmodel estimates the parameters of logistic regression model using a binomial formula and logit link function for data QUKtdayX.
trajectoryab

trajectoryab fits a second-order velocity model and produces a t-x trajectory for vehicle = i where i = 3,4, ..., nveh.
theta

The exponential deceleration rate theta of the lead vehicle.
t2

t2 is time the following vehicle realizes the lead vehicle is decelerating.
vehdf

vehdf selects information about vehicle veh of the df matrix for analysis with the brktrials2 function.
vehfix

vehfix fixes hsafe violation with speed ufix and location xfix and yfix vectors from brktrials2
plotmerge3

plotmerge3 creates t-x safe headway trajectories.
vehid

vehid selects information about vehicle veh from the tuxv matrix for analysis with the brktrials3 function.
speedts

speedts speed data used by speedtsplot
speedtsplot

The function speedtsplot plots the data from the speedts data frame.
plotoptimize

plotoptimise produces t-x trajectories for nveh drivers
uf1

The following f vehicle speed uf1 at time t1.
xl0

The lead l vehicle location xl0 at time t0.
vehtfix

vehtfix fixes hsafe violations for vehicle veh.
uf2

The following f vehicle speed uf2 at time t2.
xl1

The lead l vehicle location xl1 at time t1.
xl2

The lead l vehicle location xl2 at time t2.
t3

t3 is time the lead vehicle completes deceleration.
ubreakdown

The ubreakdown function generates a breakdown speed vector ubk assuming a lognormal distribution.
usdBBridge

The usdBBridge function from Iacus.
uf0

The following f vehicle speed uf0 at time t0.
ul0

The lead l vehicle speed ul0 at time t0.
ul1

The following l vehicle speed ul1 at time t1.
usdzipper

The usdzipper function is used to perform a sensitivity analysis of a single vehicles in traffic breakdown.
xf0

The lead f vehicle location xf0 at time t0.
xabmerge3

xabmerge3 produces t-x trajectories for a pair of lead and following vehicles.
xf1

The lead f vehicle location xf1 at time t1.
xabparam

Estimate the parameters a and b of a first-order acceleration model a + b * t.
acceldown

The acceldown function estimates the relative locations of a vehicle downstream of a bottleneck.
crossconflict

The function crossconflict a graph showing driver conflict of two vehicles changing lanes.
brktrials3

brktrials3 produces t-x trajectories for lead and following vehicles at a bottleneck
decelmerge

The decelmerge function estimates the relative locations of two vehicles where one passes the other.