check_window_width: Check Window Width

Description Usage Arguments Value Examples

View source: R/helper.R

Description

This helper functions checks if a given window width is valid. It allows to streamline the argument checking inside of generic_C_interface, rolling_apply, and similar functions.

Usage

1
2
check_window_width(width, des = "rolling window width",
  require_positive = TRUE)

Arguments

width

a non-negative, finite duration object, specifying the temporal width of a rolling time window.

des

a description of the argument that is being checked.

require_positive

logical. Whether width is required to be positive instead of only non-negative.

Value

This function does not return a value. It executes successfully if its argument is a valid window width, and stops with an error message otherwise.

Examples

1

andreas50/utsOperators documentation built on May 25, 2019, 7:16 a.m.