Learn R Programming

BoardGames (version 1.0.0)

is_palindrome: Palindrome checker.

Description

This function checks if the supplied vector is a palindrome (reads the same forwards and backwards).

Usage

is_palindrome(x, case.sensitive = FALSE)

Arguments

x
Numeric or character vector.
case.sensitive
Does upper or lower casing matter? Defaults to FALSE.

Examples

Run this code
test1 = 123
test2 = "12321"
test3 = c("a",1,2,3,2,1,"a")
is_palindrome(test1)
is_palindrome(test2)
is_palindrome(test3)

Run the code above in your browser using DataLab