vein (version 0.7.8)

age: Returns amount of vehicles at each age applying survival functions

Description

age_ldv returns amount of vehicles at each age

Usage

age(x, type = "weibull", a = 14.46, b = 4.79, name = "veh",
  agemin = 1, agemax = 50, k = 1, net, verbose = FALSE, namerows)

Arguments

x

Numeric; numerical vector of vehicles with length equal to lines features of road network

type

Character; any of "gompertz", "double_logistic", "weibull" and "weibull2"

a

Numeric; parameter of survival equation

b

Numeric; parameter of survival equation

name

Character; of vehicle assigned to columns of dataframe

agemin

Integer; age of newest vehicles for that category

agemax

Integer; age of oldest vehicles for that category

k

Numeric; multiplication factor. If its length is > 1, it must match the length of x

net

SpatialLinesDataFrame or Spatial Feature of "LINESTRING"

verbose

Logical; message with average age and total numer of vehicles

namerows

Any vector to be change row.names. For instance, name of regions or streets.

Value

dataframe of age distrubution of vehicles

Examples

Run this code
# NOT RUN {
{
data(net)
PC_E25_1400 <- age(x = net$ldv)
plot(PC_E25_1400)
PC_E25_1400 <- age(x = net$ldv,  net = net)
plot(PC_E25_1400)
}
# }

Run the code above in your browser using DataCamp Workspace