gentransform: Transforms data structure (vector, "genasis", "openair")

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/gentransform.R

Description

Function gentransform enables to transform different data structures used in the genasis package one to another.

Usage

1
gentransform(x, y=NA, input="openair", output=NA, pollutant=NA)

Arguments

x

vector of concentration values or data frame of genasis/openair type. See 'Details' for more detailed description of both data types.

y

vector of measurement dates in the case of vector input only.

input

type of data frame in the case of data frame input. The allowed values are "openair" (default) and "genasis". In case of vector input, this argument is meaningless.

output

type of output data frame. As in the input argument, both data frames "openair" and "genasis" are available, with the default value equal to input.

pollutant

name of the pollutant(s), which will be included into resulting data frame.

Details

The gentransform function serves from transforming data from one three different input formats to one of two formats used in genasis package: Option "openair" uses openair format of data frame with first column of name 'date' and class "Date", optional columns of names "date_end", "temp", "wind" and "note" and other columns of type "numeric" containing concentration values and named by names of the compounds. input="genasis" is used for input of a data frame with six columns "valu", "comp", "date_start", "date_end", "temp" and "wind" where the first, fifth and sixth are of class "numeric", second of class "character" and third and fourth columns could be both "character" or "Date" class. The names of columns in input="genasis" are not rigid, only their order is assumed. There is also a possibility to input x and y as two vectors of equal lenght, first of class "numeric" containing concentration values, second of class "character" or "Date" containing measurement dates.

Argument output must be specified in the case of vector input. In other cases it is set up equal to input, which lefts the data frame without significant changes (except sorting the rows by date).

Value

res

Data frame or vector depending on the output argument, containing recalculated values of POPs air concentrations (in mass unit per cubic meter).

Author(s)

Jiri Kalina
kalina@mail.muni.cz

See Also

genloq, genoutlier, genhistogram, genpastoact, genanaggr, genplot, genstatistic, genwhisker

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Input as a pair of vectors.
gentransform(c(0.386,0.256,0.182,0.254),
             c("2013-05-01","2013-06-03","2013-07-05","2013-08-07"),
             output="genasis")
gentransform(c(0.386,0.256,0.182,0.254),
             c("2013-05-01","2013-06-03","2013-07-05","2013-08-07"),
             output="openair",pollutant="PeCB")

## Not run:  ## Data frame inputs:
data(kosetice.act.genasis)
gentransform(kosetice.act.genasis,input="genasis",output="openair")
data(kosetice.pas.openair)
gentransform(genpastoact(genoutlier(kosetice.pas.openair,plot=FALSE)$res),
             output="genasis")
## End(Not run)

genasis documentation built on May 1, 2019, 10:16 p.m.