printVar: Print or write variables of interest

Description Usage Arguments Value Author(s) Examples

View source: R/printVar.R

Description

This function allows to print or write some of the variables simulated by the DWB model.

Usage

1
printVar(variable, coor_cells, var_name, coord_sys, dates, as, path_var = "")

Arguments

variable

corresponds to the results of a specific variable of the DWBCalculator.

coor_cells

coordinates of the cells in the same order that were simulated and that will be used to create the results in raster format, this is done from the data frames which contain the simulated results

var_name

name of the variable that will be printed (e.g., q_total, aet, r, qd, qb, s, g)

coord_sys

geographic or projected coordinate system.

dates

dates that were simulated.

as

option to print the results as independent 'raster' (.tif) or in a 'NetCDF' file (.nc).

path_var

path of the directory where one wants to print the files

Value

It saves in a folder previously created a set of raster files with the results of the variable of interest.

Author(s)

Carolina Vega Viviescas <cvegav@unal.edu.co>
Nicolas Duque Gardeazabal <nduqueg@unal.edu.co>
Pedro Felipe Arboleda Obando <pfarboledao@unal.edu.co>
David Zamora <dazamoraa@unal.edu.co>

Water Resources Engineering Research Group - GIREH Universidad Nacional de Colombia - sede Bogota

Examples

1
2
3
4
5
6
7
data(sogamoso)
dwb_results <- sogamoso$dwb_results
data(cells)
dates <- seq(as.Date("2001-01-01"), as.Date("2010-12-01"), by="month")
coord_sys <- "+init=epsg:4326"
r <- dwb_results[[3]][,1:20]
printVar(r, cells, var_name = "r", coord_sys, dates, as = "NetCDF", path_var = tempdir())

dazamora/DWBmodelUN documentation built on Aug. 29, 2020, 11:41 a.m.