vein (version 1.1.3)

Emissions: Construction function for class "Emissions"

Description

Emissions returns a transformed object with class "Emissions". The type of objects supported are of classes "matrix", "data.frame" and "numeric". If the class of the object is "matrix" this function returns a dataframe.

Usage

Emissions(x, mass = "g", time, ...)

# S3 method for Emissions print(x, ...)

# S3 method for Emissions summary(object, ...)

# S3 method for Emissions plot( x, pal = "colo_angelafaye_Coloured_sky_in", rev = FALSE, fig1 = c(0, 0.8, 0, 0.8), fig2 = c(0, 0.8, 0.55, 1), fig3 = c(0.7, 1, 0, 0.8), mai1 = c(0.2, 0.82, 0.82, 0.42), mai2 = c(1.3, 0.82, 0.82, 0.42), mai3 = c(0.7, 0.72, 0.82, 0.42), main = NULL, bias = 1.5, ... )

Value

Objects of class "Emissions" or "units"

Arguments

x

Object with class "data.frame", "matrix" or "numeric"

mass

Character to be the time units as numerator, default "g" for grams

time

Character to be the time units as denominator, eg "h"

...

ignored

object

object with class "Emissions"

pal

Palette of colors available or the number of the position

rev

Logical; to internally revert order of rgb color vectors.

fig1

par parameters for fig, par.

fig2

par parameters for fig, par.

fig3

par parameters for fig, par.

mai1

par parameters for mai, par.

mai2

par parameters for mai, par.

mai3

par parameters for mai, par.

main

title of plot

bias

positive number. Higher values give more widely spaced colors at the high end.

Examples

Run this code
if (FALSE) {
data(net)
data(pc_profile)
data(fe2015)
data(fkm)
PC_G <- c(33491,22340,24818,31808,46458,28574,24856,28972,37818,49050,87923,
          133833,138441,142682,171029,151048,115228,98664,126444,101027,
          84771,55864,36306,21079,20138,17439, 7854,2215,656,1262,476,512,
          1181, 4991, 3711, 5653, 7039, 5839, 4257,3824, 3068)
veh <- data.frame(PC_G = PC_G)
pc1 <- my_age(x = net$ldv, y = PC_G, name = "PC")
pcw <- temp_fact(net$ldv+net$hdv, pc_profile)
speed <- netspeed(pcw, net$ps, net$ffs, net$capacity, net$lkm, alpha = 1)
pckm <- units::as_units(fkm[[1]](1:24), "km"); pckma <- cumsum(pckm)
cod1 <- emis_det(po = "CO", cc = 1000, eu = "III", km = pckma[1:11])
cod2 <- emis_det(po = "CO", cc = 1000, eu = "I", km = pckma[12:24])
#vehicles newer than pre-euro
co1 <- fe2015[fe2015$Pollutant=="CO", ] #24 obs!!!
cod <- c(co1$PC_G[1:24]*c(cod1,cod2),co1$PC_G[25:nrow(co1)])
lef <- ef_ldv_scaled(co1, cod, v = "PC",  cc = "<=1400",
                     f = "G", p = "CO", eu=co1$Euro_LDV)
E_CO <- emis(veh = pc1,lkm = net$lkm, ef = lef, speed = speed, agemax = 41,
             profile = pc_profile)
dim(E_CO) # streets x vehicle categories x hours x days
class(E_CO)
plot(E_CO)
####
Emissions(1)
Emissions(1, time = "h")
}

Run the code above in your browser using DataLab