reformat_fields: Reformat Standard Fields

Description Usage Arguments Details Value Examples

View source: R/export.r

Description

Reformat standard RAStestR fields as standard R data types.

Usage

1
reformat_fields(ld, time.col = "Time", station.col = "Station")

Arguments

ld

A data table.

time.col

The time column name. To skip formatting the times, set to NULL.

station.col

(For long tables) The station column name. To skip formatting the stations, set to NULL.

Details

Values in the Time column are formatted as R timestamps (POSIXct). No adjustments for daylight savings or leap years are made. Values in the Station column of long-format tables are converted to numeric values.

Value

The data table with reformatted fields.

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")
reformat_fields(quasi.flow)

long.flow = to_longtable(quasi.flow, "Flow")
reformat_fields(long.flow)

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