Re: [R] using an array of strings with strsplit, issue when including a space in split criteria

2009-09-08 Thread Tony Breyal
After further investigation it appears that the problem is specific to my Vista PC. I am able to get the correct results using R 2.9.2 on a Window XP 64bit machine. However i do not know why this does not work on my Vista PC. The following was done after rebooting Vista. From CMD.exe I ran the

Re: [R] using an array of strings with strsplit, issue when including a space in split criteria

2009-09-08 Thread Tony Breyal
UPDATE: I'm not sure why, but on my Windows XP 64bit machine, I ran the same code again and this time it is not working even though it worked previously. This has been done using the Rgui --vanilla command. x - c(Weekly sales figures to 30 August 2008 published 5 September, Weekly sales

Re: [R] using an array of strings with strsplit, issue when including a space in split criteria

2009-09-08 Thread Tony Breyal
SOLVED. Thanks to a reply off-list it appears that the 'space' in published 11 is actually some kind of multibyte character. If I physically delete the 'space' and replace it by using the spacebar on my keyboard, then strsplit() behaves as expected. I had got the text from a hyperlink and copy

[R] using an array of strings with strsplit, issue when including a space in split criteria

2009-09-07 Thread Tony Breyal
Dear all, I'm having a problem understanding why a split does not occur with in the 2nd use of the function strsplit below: # text strings txt - c(sales to 23 August 2008 published 29 August, + sales to 6 September 2008 published 11 September) # first use strsplit(txt, 'published',

Re: [R] using an array of strings with strsplit, issue when including a space in split criteria

2009-09-07 Thread Juliet Hannah
I get a different result: txt - c(sales to 23 August 2008 published 29 August,sales to 6 September 2008 published 11 September) strsplit(txt, 'published ', fixed=TRUE) [[1]] [1] sales to 23 August 2008 29 August [[2]] [1] sales to 6 September 2008 11 September sessionInfo() R version 2.9.0

Re: [R] using an array of strings with strsplit, issue when including a space in split criteria

2009-09-07 Thread Gabor Grothendieck
I am using the exact same version of R as you also on Vista but can't reproduce your result. For me it splits properly. Try starting R like this (modify path if needed) from the Windows cmd line: \Program Files\R\R-2.9.2\bin\Rgui --vanilla and then try it. On Mon, Sep 7, 2009 at 11:40 AM,