read_swat_data: Read SWAT+ output data

View source: R/run_swat.R

read_swat_dataR Documentation

Read SWAT+ output data

Description

Read SWAT+ output data

Usage

read_swat_data(
  filename,
  path,
  vars = "all",
  swat_units = "all",
  date_range = "all"
)

Arguments

filename

Name of SWAT+ output file

path

Path to SWAT+ output files

vars

Variables to read from the file. See details

swat_units

Vector of spatial units to select from the "unit" column

date_range

Date vector (length 2) specifying the date range to read

Details

This function is used to read SWAT+ output data into a data.frame format. Data is read from the filename in the path directory. The vars parameter specifies the columns to read and the swat_units specifies the units to select.

If vars is set to "names", the function returns a vector of variable names contained in the file.

Value

The function returns a data.table object, which is useful for large datasets. If desired, it can easily be converted to a data.frame using as.data.frame.


gopalpenny/goSWATplus documentation built on Nov. 8, 2022, 9:27 p.m.