Dear all, I am trying to use "sub" to replace patterns in a character array that contains german names with german special characters. I have the following problem:> sub("\\xdf","ss","Wei\xdferitzkreis")Error in sub(pattern, replacement, x, ignore.case, extended, fixed, useBytes) : input string 1 is invalid in this locale> sub("\xdf","ss","Wei\xdferitzkreis")Error in sub(pattern, replacement, x, ignore.case, extended, fixed, useBytes) : 'pattern' is invalid in this locale Does anybody know how to tackle this problem ? thanks a lot!! Marco [[alternative HTML version deleted]]
Try Sys.setlocale(). marco.R.help marco.R.help wrote:> > I am trying to use "sub" to replace patterns in a character array that > contains german names with german special characters. I have the following > problem: > >> sub("\\xdf","ss","Wei\xdferitzkreis") > Error in sub(pattern, replacement, x, ignore.case, extended, fixed, > useBytes) : > input string 1 is invalid in this locale >> sub("\xdf","ss","Wei\xdferitzkreis") > Error in sub(pattern, replacement, x, ignore.case, extended, fixed, > useBytes) : > 'pattern' is invalid in this locale > > Does anybody know how to tackle this problem ? >-- View this message in context: http://www.nabble.com/problem-with-sub-%21-tf4141431.html#a11781512 Sent from the R help mailing list archive at Nabble.com.