Extracts the numeric depth values found in the observed data, as loaded by load_observed(). Can be filtered by variable.

get_swap_depths(data, variable = NULL)

Arguments

data

as loaded by load_observed() (dataframe)

variable

only returns depths of the given variable when passed. leave blank for all. (string)

Value

Returns a numeric vector of depths

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"

# load some SWAP data (either observed, or modeled using load_swap_output())
data <- load_swap_observed(project_path = example_path, verbose = TRUE)
#>Observed data already loaded, not reloading. (use force=TRUE to force reload) 

get_swap_depths(data, variable = "TEMP")
#> [1] 15 40 70