operate_sediment: Table Operations (Sediment)

Description Usage Arguments Value Examples

Description

Combine sediment tables via an operation, e.g. addition or multiplication.

Usage

1
2
operate_sediment(..., fun, partial = FALSE, time.col = "Time",
  grain.col = "GrainClass")

Arguments

...

Arbitrary number of wide-format data tables to combine.

fun

A function to apply. If multiple tables are supplied in ..., fun must either be one of the strings "+", "-", "*" and "/" or be a function that accepts exactly two arguments. If only one table is supplied in ..., fun must accept exactly one argument.

partial

If TRUE, only the overlapping times and columns will be processed.

time.col

The time column name.

grain.col

the grain class column name.

Value

A single sediment table.

Examples

1
2
3
4
5
6
7
8
simple.quasi = system.file("sample-data/SampleQuasiUnsteady.hdf",
  package = "RAStestR")
quasi.voloutcum = read_sediment(simple.quasi, "Vol Out Cum")

operate_sediment(quasi.voloutcum, quasi.voloutcum, fun = "+")
operate_sediment(quasi.voloutcum, quasi.voloutcum, fun = "-")
operate_sediment(quasi.voloutcum, fun = function(x) 2*x)
operate_sediment(quasi.voloutcum, fun = function(x) x*x)

mkoohafkan/RAStestR documentation built on July 14, 2019, 11:41 p.m.