adt: Average daily traffic (ADT) from hourly traffic data.

Description Usage Arguments Value Examples

View source: R/adt.R

Description

adt calculates ADT based on hourly traffic data. The input traffic data is usually for morning rush hours.

Usage

1
adt(pc, lcv, hgv, bus, mc, p_pc, p_lcv, p_hgv, p_bus, p_mc, expanded = FALSE)

Arguments

pc

numeric vector for passenger cars

lcv

numeric vector for light commercial vehicles

hgv

numeric vector for heavy good vehicles or trucks

bus

numeric vector for bus

mc

numeric vector for motorcycles

p_pc

data-frame profile for passenger cars, 24 hours only.

p_lcv

data-frame profile for light commercial vehicles, 24 hours only.

p_hgv

data-frame profile for heavy good vehicles or trucks, 24 hours only.

p_bus

data-frame profile for bus, 24 hours only.

p_mc

data-frame profile for motorcycles, 24 hours only.

expanded

boolean argument for returning numeric vector or "Vehicles"

Value

numeric vector of total volume of traffic per link, or data-frames of expanded traffic

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
data(net)
data(pc_profile)
p1 <- pc_profile[, 1]
adt1 <- adt(pc = net$ldv*0.75,
            lcv = net$ldv*0.1,
            hgv = net$hdv,
            bus = 0,
            mc = net$ldv*0.15,
            p_pc = p1,
            p_lcv = p1,
            p_hgv = p1,
            p_bus = p1,
            p_mc = p1)
head(adt1)
plot(adt1)
adt2 <- adt(pc = net$ldv*0.75,
            lcv = net$ldv*0.1,
            hgv = net$hdv,
            bus = net$hdv,
            mc = net$ldv*0.15,
            p_pc = p1,
            p_lcv = p1,
            p_hgv = p1,
            p_bus = p1*0, # when zero, must be the same size
            p_mc = p1,
            TRUE)
head(adt2)
plot(adt2) # Class Vehicles
}

ibarraespinosa/vein documentation built on Sept. 10, 2018, 1:53 a.m.