Learn R Programming

briskaR (version 1.0.4)

brk_emission: Wrapper function brk_emission

Description

`brk_emission` This function simulates emissions. Will simulate emissions shape in source fields of a landscape.

`brk_emission_landscape` Simulate sources emission intensity. With: - `emission` is the quantity of emission per time unit per spatial unit. With other argument, we have: - `emission = density x intensity = density x production x intensity_pmf`. - `density` is the density of the source, so the quantity of source per spatial unit. - `intensity` is the intensity of the emission for 1 source: that is the quantity of emission per time unit per source. - `production` is the overall production, the total emission, for one source unit: quantity of emission for the period - `intensity_pmf` is the distribution of emission along time. So we have `intensity = production x intensity_pmf`.

Usage

brk_emission(sf, keyTime, key, FUN)

brk_emission_landscape( sf, timeline = 1:61, emission = NULL, density = NULL, intensity = NULL, intensity_pmf = NULL, production = NULL )

Arguments

sf

A sf object

keyTime

character. Name of the column for timeline. Used to check length of vectors in column vector object

key

character. Name of the column which is going to be created

FUN

A function applied on the sf object. See lapply functions for further details assuming X = 1:nrow(sf), that is sf[[key]] <- lapply(1:nrow(sf), FUN, ...).

timeline

Vector of time units (e.g. days) covering all the function

emission

Vector or Matrix given the quantity of emission per time unit per spatial unit. Length of vector equal the length of the `timeline` vector (time unit matching). Size of the matrix, `n,m`, is such as the number of row equal the number of sources in `sf` object, and the number of column equals the length of the `timeline` vector.

density

Scalar or Vector (with length equal to the number of sources in `sf` object) given the density of the source(s) (e.g. number of plant by squared meter)

intensity

Vector or Matrix given the quantity of emission per time unit per source. Length of vector equal the length of the `timeline` vector (time unit matching). Size of the matrix, `n,m`, is such as the number of row equal the number of sources in `sf` object, and the number of column equals the length of the `timeline`.

intensity_pmf

Vector or Matrix given distribution of emission along time (given a probability mass function with time) . Length of vector equal the length of the `timeline` vector (time unit matching). Size of the matrix, `n,m`, is such as the number of row equal the number of sources in `sf` object, and the number of column equals the length of the `timeline`.

production

Scalar or Vector (with length equal to the number of sources in `sf` object) total emission for one source (e.g. total number of grains by plant)

Value

A matrix indexed by sources ID (in rows) and by time ( in columns) whose rows give the values of intensity emission (number of grains) for every source.

Details

This function is a wrapper of with and lapply function and is like this: sf[["key"]] <- with(sf, lapply(1:nrow(sf), FUN, ...))

So, all column of sf can be called in FUN