Re: [R] Confusing behavior when using gsub to insert unicode character (minimal working example provided)

2014-06-04 Thread Thomas Stewart
Yep. You are right. That is better. -tgs On Thu, May 29, 2014 at 5:23 PM, Ista Zahn wrote: > 10Hi Thomas, > > On Thu, May 29, 2014 at 9:15 AM, Thomas Stewart > wrote: > > Thanks to to Ista Zahn, I was able to find a work around solution. The > key > > seems to be that string1 needs to be en

Re: [R] Confusing behavior when using gsub to insert unicode character (minimal working example provided)

2014-05-29 Thread Ista Zahn
10Hi Thomas, On Thu, May 29, 2014 at 9:15 AM, Thomas Stewart wrote: > Thanks to to Ista Zahn, I was able to find a work around solution. The key > seems to be that string1 needs to be encoded as UTF-8 prior to being passed > to gsub. For whatever reason, > > Encoding(string1) <- "UTF-8" > > doe

Re: [R] Confusing behavior when using gsub to insert unicode character (minimal working example provided)

2014-05-29 Thread Thomas Stewart
Thanks to to Ista Zahn, I was able to find a work around solution. The key seems to be that string1 needs to be encoded as UTF-8 prior to being passed to gsub. For whatever reason, Encoding(string1) <- "UTF-8" does not change the encoding on my Windows machine. The work around: I paste an obv

Re: [R] Confusing behavior when using gsub to insert unicode character (minimal working example provided)

2014-05-28 Thread David Winsemius
On May 28, 2014, at 7:25 PM, Thomas Stewart wrote: > Can anyone help me understand the following behavior? > > I want to replace the letter 'X' in > ​the string ​ > 'text X' with '≥' (\u226 > ​5 > ). The output from gsub is not what I expect. It gives: "text ≥". > > Now, suppose I want to r

[R] Confusing behavior when using gsub to insert unicode character (minimal working example provided)

2014-05-28 Thread Thomas Stewart
Can anyone help me understand the following behavior? I want to replace the letter 'X' in ​the string ​ 'text X' with '≥' (\u226 ​5 ). The output from gsub is not what I expect. It gives: "text ≥". Now, suppose I want to replace the character '≤' in ​ the string​ 'text ≤'