read_r2c_shed: Reads r2c file of a MESH watershed

Description Usage Arguments Value Author(s) See Also Examples

View source: R/read_r2c_shed.R

Description

This function reads in a file containing the layers which define a MESH watershed. To read in a file of timeseries, use the function r2c2raster.

Usage

1
read_r2c_shed(r2cFile = "", values_only = TRUE, as_rasters = TRUE)

Arguments

r2cFile

Required. Name of r2c file.

values_only

Optional. If TRUE (the default), then only the values are returned, either as a raster brick (useful for plotting) or as a 3D array (useful for analysis). If FALSE, then a list will be returned, containing the 1) the data, 2) the metadata (the variable names, types and units) are returned for each layer, and 3) the r2c file header lines.

as_rasters

Optional. If TRUE, the layers will be returned as as raster brick. If FALSE, they will be returned as an array.

Value

Returns either an array or a raster brick of values, and optionally, the meta data and file header.

Author(s)

Kevin Shook

See Also

read_r2c_raster

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
# read in basin as a raster brick
basin <-  read_r2c_shed("MESH_drainage_database.r2c")
# read in as an array
basin_array <- read_r2c_shed("MESH_drainage_database.r2c", as_rasters = FALSE)
# get meta data as well
basin_array <- read_r2c_shed("MESH_drainage_database.r2c", values_only = FALSE, 
as_rasters = FALSE)

## End(Not run)

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