Does a vector have non-zero variability?

does_vary(x, na.rm = TRUE)

Arguments

x

Input variable

na.rm

If TRUE missing values are removed before calculation

Value

Logical. TRUE is there is variability

Examples

summarise_all(diamonds, does_vary) %>% as.logical()
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE