sbi_bybasin_function: SBI Function. For calculating SBI by basin. Function for...

View source: R/sbi_bybasin_function.R

sbi_bybasin_functionR Documentation

SBI Function. For calculating SBI by basin. Function for calculating and saving the SBI by year. Select a year, a survey period (can be all), and this function calculates the SBI and the sites statistics and saves both as two csv files.

Description

This function gives you the SBI for one, multiple, or all basins by water year for a specific day or survey period.

Usage

sbi_bybasin_function(
  date_sbi = Sys.Date(),
  all_basins = "Yes",
  exceptions = NA,
  incorrect_sites = NA,
  incorrect_data = NA,
  save_csv = c("No"),
  path
)

Arguments

date_sbi

Date that you want to calculate SBI for. Must be in date format (i.e., as.Date("YYYY-MM-DD"))

all_basins

What basin you want to calculate the SBI for. Defaults to "Yes", which will return the SBI for all of the current snow basins.

exceptions

Any sites that you want to exclude from the analysis. Defaults to NA

incorrect_sites

Manual site IDs that are showing incorrect or suspect SWE values. Defaults to NA.

incorrect_data

a string of numeric values that are the correct values for the incorrect sites identified in incorrect_sites. Defaults to NA.

save_csv

Whether the user wants to save a csv file of the final SBI values as well as the statistics from the sites used to calculate the SBI values. Can be 'Yes' or "No", but defaults to "No".

path

Path that you want to save the SBI result to


bcgov/bcsnowsbi documentation built on Oct. 22, 2022, 10:36 p.m.