write_tb0: Writes a MESH tb0 file

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

View source: R/write_tb0.R

Description

Writes a MESH tb0 file

Usage

1
2
3
4
5
6
7
write_tb0(
  values = NULL,
  column_meta = NULL,
  header = NULL,
  NAvalue = -1,
  tb0File = ""
)

Arguments

values

Optional. A data frame of the values to be written, if the file is to be a time seires. Note that the first column must be called datetime and must be a POSIXct date/time.

column_meta

Required. A data frame containing the following columns #'

columnUnits

required

columnType

required

columnName

required

columnLocationX

required

columnLocationY

required

DA

optional

coeff1

optional

coeff2

optional

coeff3

optional

coeff4

optional

coeff5

optional

header

Required. A list containing the following variables

filetype

optional, default is tb0 ASCII EnSim 1.0

datatype

optional, default is Time Series

application

optional, default is EnSimHydrologic

version

optional, default is default is 2.1.23

written_by

optional, default is default is MESHr

creation_date

optional, default is current date/time

source_file

optional, default is nothing

name

required

projection

required, character string

ellipsoid

required, character string

start_time

required if values are not specified

delta_t

required if values are not specified

attributeunits

optional, default is nothing

unitconversion

optional, default is nothing

NAvalue

Optional. Value to be used for NA_real_ values in the .tb0 file. The default value is -1, which is not suitable for air temperatures.

tb0File

Required. Name of file to be written.

Value

If successful, returns TRUE. If unsuccessful, returns FALSE

Note

If you have read in the header data from another file, and you want to use the default values, you can just replace the existing values with a NULL value. You might want to do this to use the new start time, and creation date.

Author(s)

Kevin Shook

See Also

read_tb0

Examples

1
2
3
4
5
6
## Not run:  
header$start_time <- NULL
header$creation_date <- NULL
write_tb0(values, column_meta_data, header, "MESH_values.ts0")

## End(Not run)

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