I have a few strings in a data set that contain the caharacters
\x96
\x92
and others.
I cant figure out how to grep for them in R.
I have tried using
pattern="\x96"
pattern="\\x96"
pattern="x96"
but to no avail.
Is there a specific way of dealing with such characters, specifically in R.
** UPDATE **
as per the suggestion in the comments, perl=TRUE
allows the grep to work
Can anyone offer a solid explanation of what is going on?
session info, in case relevant
> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=C LC_COLLATE=C LC_MONETARY=C LC_MESSAGES=C LC_PAPER=C LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=C LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_0.9.3 RMySQL_0.9-3 DBI_0.2-5 stringr_0.6.1 data.table_1.8.6