is_palindrome: Palindrome checker.

Description Usage Arguments Examples

View source: R/xy2index.R

Description

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

Usage

1
is_palindrome(x, case.sensitive = FALSE)

Arguments

x

Numeric or character vector.

case.sensitive

Does upper or lower casing matter? Defaults to FALSE.

Examples

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

Example output

[1] FALSE
[1] TRUE
[1] TRUE

BoardGames documentation built on May 2, 2019, 3:45 a.m.