read_MESH_OutputTimeseries_ts: Reads MESH output .ts file containing timeseries

Description Usage Arguments Value Author(s) See Also Examples

View source: R/read_MESH_OutputTimeseries_ts.R

Description

Reads a file containing any output from a MESH model as a .ts file into a standard R data frame.

Usage

1
2
3
4
5
6
read_MESH_OutputTimeseries_ts(
  tsFile,
  variableNames = "",
  timezone = "",
  missingValueThreshold = -0.1
)

Arguments

tsFile

Required. Name of MESH output file. Must be a .ts file.

variableNames

Optional. The names of the variables as a string vector. If not specified, the variables will be names Var1, Var2, etc.

timezone

Not required for daily time series. Required for sub-daily time series. The name of the timezone of the data as a character string. This should be the timezone of your data, but omitting daylight savings time. Note that the timezone code is specific to your OS. To avoid problems, you should use a timezone without daylight savings time. You can use etc/GMT+6 or etc/GMT+7 for Central Standard and Mountain Standard time, respectively. DO NOT use America/Regina as the time zone, as it includes historical changes between standard and daylight savings time.

missingValueThreshold

Optional. Any value smaller than this value will be set to NA_real_ when the file is imported. The default value is -0.1 to prevent zero values from being affected.

Value

If successful, returns a data frame. The first columns will be called DATE for daily values, and will contain a standard R date. For sub-daily timeseries the first column will be called DATETIME and will contain a standard POSIXct date/time. If unsuccessful, returns the value FALSE.

Author(s)

Kevin Shook

See Also

read_MESH_OutputTimeseries_csv

Examples

1
2
3
4
5
## Not run: 
timezone <- 'etc/GMT+6'
outfile <- "SNO_D_GRD.ts"
output <- read_MESH_ts(outfile, timezone)
## End(Not run)

CentreForHydrology/MESHr documentation built on Jan. 11, 2021, 8:34 p.m.