combine_data: Combine Data Tables

Description Usage Arguments Value Examples

View source: R/export.r

Description

Combine data tables into a single table. The tables must have identical column names. For data sourced from plans with different geometry or stations, use to_longtable to format the tables consistently before combining. If combining tables of different data, provide explicit names to the tables to easily differentiate between variables.

Usage

1
combine_data(..., data.list, id.col = "table")

Arguments

...

Series of named tables to combine.

data.list

Alternative input to .... A single list of data tables to combine. If not named, the elements will be named sequentially using id.col, e.g. "table 1", "table 2", etc.

id.col

The name of the new column containing data source IDs.

Value

A single data table with an additional column specifying the data source.

Examples

1
2
3
4
5
6
7
simple.quasi = system.file("sample-data/SampleQuasiUnsteady.hdf",
  package = "RAStestR")
quasi.flow = read_standard(simple.quasi, "Flow")
quasi.wse = read_standard(simple.quasi, "Water Surface")
long.flow = to_longtable(quasi.flow, "Value")
long.wse= to_longtable(quasi.flow, "Value")
combine_data(flow = long.flow, wse = long.wse, id.col = "Variable")

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