Skip to contents

Replace empty PCP entry with 0

Usage

add_missing_pcp_zero(df_to_correct, df_valid = NULL, value_to_zero = 0.2)

Arguments

df_to_correct

dataframe to correct for PCP variable with "DATE" and "PCP" columns.

df_valid

(optional) dataframe with valid data for PCP variable with "DATE" and "PCP" columns. Also should overlap with df_to_correct data.

value_to_zero

(optional) numeric value of daily PCP. Only NA values can be set to 0 when df_valid PCP values are below or equal to value_to_zero (default 0.2).

Value

updated dataframe

Examples

if (FALSE) {
met_lst$data$ID8$PCP <- add_missing_pcp_zero(met_lst$data$ID8$PCP, met_lst$data$ID9$PCP)
}