This function loads your observed data from the template file that was placed
in your project directory either by build_rswap_directory()
or rswap_init()
load_swap_observed(project_path, force = F, archived = F, verbose = F)
returns a dataframe of your observed data
It is critical that the template observed file is filled out correctly.
Please see the file itself for more information. It should be located in
your project directory, and must bear the name swap_observed_data.csv
.
# 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_observed(example_path, verbose = TRUE)
#> ℹ Observed data already loaded, not reloading. (use force=TRUE to force reload)
#> # A tibble: 36 × 10
#> DATE H_15 H_40 H_70 WC_15 WC_40 WC_70 TEMP_15 TEMP_40 TEMP_70
#> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 2002-01-31 -55.1 -26.5 -1.76 0.315 0.367 0.308 12.0 2.53 3.07
#> 2 2002-02-28 -40.5 -14.8 9.26 0.342 0.404 0.308 7.39 1.84 2.53
#> 3 2002-03-31 -73.6 -36.9 -11.1 0.287 0.331 0.298 13.4 2.29 2.60
#> 4 2002-04-30 -55.5 -30.3 -5.62 0.314 0.354 0.305 14.2 2.88 3.56
#> 5 2002-05-31 -74.3 -37.1 -11.3 0.286 0.330 0.297 17.4 3.92 5.11
#> 6 2002-06-30 -115. -61.3 -31.1 0.244 0.260 0.251 20.6 4.47 5.93
#> 7 2002-07-31 -16.6 -85.0 -49.3 0.397 0.212 0.207 30.8 6.30 7.62
#> 8 2002-08-31 -149. -86.2 -52.3 0.220 0.210 0.201 22.6 5.39 7.38
#> 9 2002-09-30 -166. -112. -74.5 0.210 0.175 0.163 17.1 4.06 5.74
#> 10 2002-10-31 -84.6 -65.1 -55.2 0.274 0.251 0.195 9.79 2.78 4.22
#> # ℹ 26 more rows