Learn R Programming

chillR (version 0.75)

test_if_equal: Test if all character vectors in a string are equal

Description

Compares all elements of a vector of numbers or character strings and returns TRUE if they are all the same, FALSE otherwise.

Usage

test_if_equal(test_vector)

Value

TRUE if all elements of the vector are the same; FALSE otherwise.

Arguments

test_vector

vector of strings or numbers to be tested.

Author

Eike Luedeling

Examples

Run this code

  test_if_equal(c(1,3,1))
  test_if_equal(c("a","a","a"))
  test_if_equal(c("a","b","a"))                                            
 

Run the code above in your browser using DataLab