is_palindrome {BoardGames}R Documentation

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

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

[Package BoardGames version 1.0.0 Index]