Displaying 1 result from an estimated 1 matches for "testascii".
Did you mean:
test_ascii
2016 Apr 04
0
Find the dataset(s) that contain(s) non-ASCII characters
...ind which dataset(s) (all recorded as rda files) contain(s) non-ASCII characters.
Using the iconv function let us to find or replace non-ASCII characters
iconv(x, "UTF-8", "ASCII", sub="I_WAS_NOT_ASCII")
I use the following function to detect non-ASCII characters.
testASCII <- function(idata)
{
col <- (1:NCOL(idata))[sapply(idata, is.factor)]
col <- c(col, (1:NCOL(idata))[sapply(idata, is.character)])
for(i in col)
{
x <- idata[, i]
cat(colnames(idata)[i], "\n")
res <- grep("I_WAS_NOT_ASCII", iconv(x, "latin1",...