vkm: Estimation of VKM

vkmR Documentation

Estimation of VKM

Description

vkm consists in the product of the number of vehicles and the distance driven by these vehicles in km. This function reads hourly vehicles and then extrapolates the vehicles

Usage

vkm(
  veh,
  lkm,
  profile,
  hour = nrow(profile),
  day = ncol(profile),
  array = TRUE,
  as_df = TRUE
)

Arguments

veh

Numeric vector with number of vehicles per street

lkm

Length of each link (km)

profile

Numerical or dataframe with nrows equal to 24 and ncol 7 day of the week

hour

Number of considered hours in estimation

day

Number of considered days in estimation

array

When FALSE produces a dataframe of the estimation. When TRUE expects a profile as a dataframe producing an array with dimensions (streets x hours x days)

as_df

Logical; when TRUE transform returning array in data.frame (streets x hour*days)

Value

emission estimation of vkm

Examples

## Not run: 
# Do not run
pc <- lkm <- abs(rnorm(10,1,1))*100
pro <- matrix(abs(rnorm(24*7,0.5,1)), ncol=7, nrow=24)
vkms  <- vkm(veh = pc, lkm = lkm, profile = pro)
class(vkms)
dim(vkms)
vkms2  <- vkm(veh = pc, lkm = lkm, profile = pro, as_df = FALSE)
class(vkms2)
dim(vkms2)

## End(Not run)

ibarraespinosa/vein documentation built on April 13, 2024, 8:51 p.m.