classify_wetdry {STICr}R Documentation

classify_wetdry

Description

This is a function to classify STIC data into a binary "wet" and "dry" column. Data can be classified according to any classification variable defined by the user. User can choose one of two methods for classification: either an absolute numerical threshold or as a chosen percentage of the maximum value of the classification variable.

Usage

classify_wetdry(stic_data, classify_var, threshold, method)

Arguments

stic_data

A data frame with STIC data, such as that produced by apply_calibration or tidy_hobo_data.

classify_var

Name of the column in data frame you want to use for classification. When method is "y-intercept", this should be condUncal.

threshold

This is the user-defined threshold for determining wet versus dry based on the designated classification variable. If using the "absolute" method, the threshold will be a value in the same units as the designated classification variable. If using the "percent" method, the value will be a decimal percentage (range 0-1) of the max value of the classification variable in the data frame. Values above this proportion of the maximum will be designated as wet. If using the "y-intercept" method, this should be a model fit used to generate calibrated SpC values such as that produced by get_calibration.

method

User chooses which classification method used to generate the binary data. "absolute" uses an absolute numerical threshold for classifying wet vs dry. "percent" uses a threshold based on a given percentage of the maximum value of the classification variable in the data frame. "y-intercept" uses the y-intercept from the get_calibration function.

Value

The same data frame as input, but with a new column called "wetdry".

Examples

classified_df <-
  classify_wetdry(calibrated_stic_data,
    classify_var = "SpC", method = "absolute", threshold = 200
  )
head(classified_df)

[Package STICr version 1.1.1 Index]