emis_long: Estimation with long format

View source: R/emis_long.R

emis_longR Documentation

Estimation with long format

Description

Emissions estimates

Usage

emis_long(x, lkm, ef, tfs, speed, verbose = TRUE, array = FALSE)

Arguments

x

Vehicles data.frame. x repeats down for each hour

lkm

Length of each link in km. lkm repeats down for each hour

ef

data.frame. ef repeats down for each hour

tfs

temporal factor

speed

Speed data.frame (nrow x)

verbose

Logical to show more info

array

Logical to return EmissionsArray or not

Value

long data.frame

See Also

Other China: ef_china_det(), ef_china_hu(), ef_china_h(), ef_china_long(), ef_china_speed(), ef_china_s(), ef_china_te(), ef_china_th(), ef_china(), emis_china()

Examples

{
data(net)
net <- net[1:100, ]
data(pc_profile)
x <- age_ldv(net$ldv)
pc_week <- temp_fact(net$ldv+net$hdv, pc_profile[[1]])
df <- netspeed(pc_week,
               net$ps,
               net$ffs,
               net$capacity,
               net$lkm,
               alpha = 1)

s  <- do.call("rbind",lapply(1:ncol(df), function(i) {
 as.data.frame(replicate(ncol(x), df[, i]))
}))

ef <- ef_wear(wear = "tyre",
              type = "PC",
              pol = "PM10",
              speed = as.data.frame(s))

e <- emis_long(x = x,
               lkm = net$lkm,
               ef = ef,
               tfs = pc_profile[[1]],
               speed = df)

ae <- emis_long(x = x,
               lkm = net$lkm,
               ef = ef,
               tfs = pc_profile[[1]],
               speed = df,
               array = TRUE)
}

vein documentation built on April 30, 2023, 1:10 a.m.