Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

printable_ascii

Detect the presence of non-printable or non-ascii characters


Description

Detect the presence of non-printable or non-ascii characters

Usage

printable_ascii(x)

Arguments

x

a character vector

Details

Printable ASCII characters consist of space, A-Z, a-z, 0-9 and the characters

! "" # $ % & ' ( ) * + , . / : ; < = > ? @ [ ] \ ^ _ ` { | } ~ -

Note that this excludes tab (as it is a control character).

Value

A logical indicating which elements consist solely of printable ASCII characters.

Examples

# define o-umlaut
ouml <- intToUtf8("0x00F6")
x <- c("Motorhead", paste0("Mot",ouml,"rhead"))
# second element contains a non-ascii character
printable_ascii(x)

# Control characters (like carriage return) are also excluded
printable_ascii("abc\r")

stringdist

Approximate String Matching, Fuzzy Text Search, and String Distance Functions

v0.9.6.3
GPL-3
Authors
Mark van der Loo [aut, cre] (<https://orcid.org/0000-0002-9807-4686>), Jan van der Laan [ctb], R Core Team [ctb], Nick Logan [ctb], Chris Muir [ctb], Johannes Gruber [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.