This function reads the output of the SWAP model for the last run of the
given project_path
. It can also be used to read the results of saved runs
in the "/rswap_saved" folder if archived
is set to TRUE
.
load_swap_output(project_path, archived = F, verbose = F)
Returns a list of dataframes. .$daily_output
and .$custom_depth
Currently, the function only returns the data needed by the rest of the package, but this will be expanded over time to return all SWAP output
# 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"
load_swap_output(example_path)
#> $daily_output
#> # A tibble: 1,224 × 5
#> DATE DEPTH H WC CONC
#> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 2002-01-31 -0.5 -58.4 0.294 28.2
#> 2 2002-01-31 -1.5 -57.8 0.295 32.1
#> 3 2002-01-31 -2.5 -57.1 0.296 35.1
#> 4 2002-01-31 -3.5 -56.5 0.297 38.0
#> 5 2002-01-31 -4.5 -55.8 0.299 41.3
#> 6 2002-01-31 -5.5 -55.1 0.300 44.9
#> 7 2002-01-31 -6.5 -54.4 0.301 48.8
#> 8 2002-01-31 -7.5 -53.7 0.302 52.5
#> 9 2002-01-31 -8.5 -53.0 0.303 55.9
#> 10 2002-01-31 -9.5 -52.3 0.305 58.9
#> # ℹ 1,214 more rows
#>
#> $custom_depth
#> # A tibble: 36 × 11
#> DATE RAIN H_15 H_40 H_70 WC_15 WC_40 WC_70 TEMP_15 TEMP_40
#> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 2002-01-31 4.26 -50.1 -28.6 -1.98 0.309 0.328 0.380 8.58 8.17
#> 2 2002-02-28 12.3 -36.8 -16.0 10.4 0.335 0.360 0.38 5.28 5.95
#> 3 2002-03-31 3.56 -66.9 -39.9 -12.4 0.282 0.296 0.368 9.56 7.39
#> 4 2002-04-30 4.21 -50.4 -32.8 -6.32 0.308 0.316 0.377 10.1 9.29
#> 5 2002-05-31 5.29 -67.5 -40.2 -12.7 0.281 0.295 0.367 12.4 12.6
#> 6 2002-06-30 4.89 -105. -66.3 -35.0 0.239 0.232 0.310 14.7 14.4
#> 7 2002-07-31 14.2 -15.1 -92.0 -55.4 0.389 0.189 0.256 22.0 20.3
#> 8 2002-08-31 6.18 -136. -93.2 -58.7 0.215 0.187 0.248 16.1 17.4
#> 9 2002-09-30 4.05 -151. -121. -83.7 0.206 0.156 0.201 12.2 13.1
#> 10 2002-10-31 9.18 -76.9 -70.5 -62.1 0.268 0.224 0.241 7.00 8.96
#> # ℹ 26 more rows
#> # ℹ 1 more variable: TEMP_70 <dbl>
#>