Skip to contents

This function is used internally to match observed values with modeled values in the same format, such that it is easy to pass them to performance indicators.

Usage

match_swap_data(
  project_path,
  variable,
  depth = NULL,
  verbose = F,
  archived = F
)

Arguments

project_path

path to project directory (string)

variable

variable to match (string)

depth

an optional depth to select for (numeric)

verbose

print status? (boolean)

archived

is the project in /rswap_saved/?

Value

Returns a list of two dataframes, .$mod and .$obs. These two dataframes have identical dimensions and column names.

Details

This function is available since it might be of use to the end user.

Examples

# path to sample results (only for package internal example, you don't need
# this function)
example_path <- system.file(package = "rswap", "extdata/rswap_example_output")

# in your own projects, you would use something like this:
# example_path <- "C:/path/to/swap_folder/example_project"

match_swap_data(example_path, "WC", depth = 15, verbose = TRUE)
#>Observed data already loaded, not reloading. (use force=TRUE to force reload) 
#> $mod
#> # A tibble: 36 × 2
#>    DATE       WC_15
#>    <date>     <dbl>
#>  1 2002-01-31 0.309
#>  2 2002-02-28 0.335
#>  3 2002-03-31 0.282
#>  4 2002-04-30 0.308
#>  5 2002-05-31 0.281
#>  6 2002-06-30 0.239
#>  7 2002-07-31 0.389
#>  8 2002-08-31 0.215
#>  9 2002-09-30 0.206
#> 10 2002-10-31 0.268
#> # ℹ 26 more rows
#> 
#> $obs
#> # A tibble: 36 × 2
#>    DATE       WC_15
#>    <date>     <dbl>
#>  1 2002-01-31 0.315
#>  2 2002-02-28 0.342
#>  3 2002-03-31 0.287
#>  4 2002-04-30 0.314
#>  5 2002-05-31 0.286
#>  6 2002-06-30 0.244
#>  7 2002-07-31 0.397
#>  8 2002-08-31 0.220
#>  9 2002-09-30 0.210
#> 10 2002-10-31 0.274
#> # ℹ 26 more rows
#>