is_ascii: Check if a character vector consists of entirely ASCII...

View source: R/encoding.R

is_asciiR Documentation

Check if a character vector consists of entirely ASCII characters

Description

Converts the encoding of a character vector to 'ascii', and check if the result is NA.

Usage

is_ascii(x)

Arguments

x

A character vector.

Value

A logical vector indicating whether each element of the character vector is ASCII.

Examples

library(xfun)
is_ascii(letters)  # yes
is_ascii(intToUtf8(8212))  # no

xfun documentation built on Nov. 17, 2022, 1:06 a.m.