[Rd] Unexpected behavior with cat

From: Russell Pierce <rpier001_at_ucr.edu>
Date: Sun, 07 Nov 2010 17:57:12 -0800


I am experiencing unexpected behavior with the command cat under Window GUI builds of R version 2.12.0 (it does not seem to be an issue in Rterm). For example if I issue the command cat(70,"\r") I get back text that looks like Asian characters. If I highlight and copy that text, it is the text I would regularly expect, e.g. the number 70 and the prompt line. Highlighting the text changes what is shown on the screen, but the screen never displays the number 70. This error is not idiosyncratic to 70 but happens with a fairly wide range of numbers. Notably no error like this occurs when I use \n. I use \r for large simulation runs when I don't want my progress to spam the display.

e.g.
for (i in 1:1000) {cat(i,"\r");flush.console();Sys.sleep(.100)}

sessionInfo() where I first saw the problem: R version 2.12.0 (2010-10-15) on Windows Vista Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

Also experienced here:

R version 2.12.0 (2010-10-15) on Windows XP
R version 2.12.0 Patched (2010-11-04 r53530) on Windows Vista
R version 2.13.0 Under development (unstable) (2010-11-04 r53530) on
Windows Vista

But not here:
Not under R version 2.10.1 (2009-12-14) on Windows XP

If this is expected behavior would you please kindly explain it to me?  I am not a member of this list, so please address replies both to my email address and (if appropriate) the list.

Best,

Russell Pierce



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon 08 Nov 2010 - 08:41:00 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 25 Nov 2010 - 14:00:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive