same: Tests if all elements of a vector are the same

Description Usage Arguments Examples

View source: R/same.r

Description

Tests if all elements of a vector are the same

Usage

1
same(x, na.rm = FALSE)

Arguments

x

Numeric or character vector.

na.rm

Logical, if TRUE then remove NAs first. If FALSE and NAs are included with other values, then the function returns FALSE.

Examples

1
2
3
4
5
6
same(1:10)
same(rep(3, 10))
same(letters[1:3])
same(c('r', 'r', 'r'))
same(c('r', 'r', 'r', NA))
same(c('r', 'r', 'r', NA), na.rm=TRUE)

adamlilith/omnibus documentation built on Nov. 21, 2018, 11:01 a.m.