View source: R/is_decreasing.R
is_decreasing | R Documentation |
is_increasing()
and is_decreasing()
are trivial wrapper functions to enhance code readability. They determine whether a numerical vector is increasing or decreasing monotonically. strictly
(default FALSE
) excludes cases where the difference between consecutive elements is zero.
is_decreasing(vec, strictly = FALSE, na.rm = FALSE)
vec |
A numerical vector. |
strictly |
Does a difference of zero count as increasing/decreasing? By default, |
na.rm |
A logical value indicating whether |
logical.
is_increasing(c(1:10)) is_increasing(c(1, 2, 2, 2, 3), strictly = TRUE) is_decreasing(c(3, 2, 2, 5, 3, 2, 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.