1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{printable_ascii}
\alias{printable_ascii}
\title{Detect the presence of non-printable or non-ascii characters}
\usage{
printable_ascii(x)
}
\arguments{
\item{x}{a \code{character} vector}
}
\value{
A \code{logical} indicating which elements consist solely of printable ASCII characters.
}
\description{
Detect the presence of non-printable or non-ascii characters
}
\details{
Printable ASCII characters consist of space, \code{A-Z}, \code{a-z}, \code{0-9} and the characters
\code{! "" # $ \% & ' ( ) * + , . / : ; < = > ? @ [ ] \\ ^ _ ` { | } ~ -}
Note that this excludes tab (as it is a control character).
}
\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")
}
|