purge_d2_cands: Get Indices For Day-2 Method

Description Usage Arguments Value Details Examples

View source: R/RcppExports.R

Description

Takes a logical vector of possible indices to sum for the Day-2 method, and cleans it to the exact indices to sum for the Day-2 method. See Details below for more information.

Usage

1
purge_d2_cands(d2_cands)

Arguments

d2_cands

A logical vector of indices associated with the vector of daily snow change observations, dx. d2_cands(i) is TRUE if and only if dx(i) and dx(i + 1) are positive.

Value

A logical vector, where TRUE indicates that that index is to be summed with the following index for the Day-2 method vector dx. As described, an index cannot be used twice. As such, there should be no two consecutive TRUE values.

Details

Given a vector of snow changes, dx, the Day-2 method needs to sum consecutive positive values. But once an index is part of a sum it cannot be used again. As such d2_cands is the logical vector where an index is TRUE if dx(i) and dx(i + 1) are both positive. Because an index cannot be used in multiple sums this function falsifies indices that follow TRUEs in the d2_cands logical vector.

Examples

1
2
3

Kinekenneth48/rdailychange documentation built on Dec. 18, 2021, 3:34 a.m.