Skip to content
Prev 4200 / 15075 Next

R.app stange behavior?

Philippe,
On Dec 29, 2007, at 7:17 AM, Philippe Grosjean wrote:

            
Although your tests are right, your explanation is not. The GUI  
doesn't force \n in general, try:
 > cat("foo"); cat("bar")
foobar

All it does is to make sure that a prompt is printed on a new line (to  
avoid prompt printed in the middle of some output). It does not affect  
output in functions, scripts etc. (hence I think the following is  
irrelevant).
The interpretation of all those codes is terminal-specific and for now  
the R.app chooses to not interpret them (however, they are preserved,  
try pasting the output in a terminal that interprets them).

As a side note, one specific issue is that of \r which seems to be  
handy at times to report progress (although not portably).  
Historically, Macs used \r to denote end of line in files and input,  
therefore we have to interpret it as what you would expect from \n for  
compatibility. With \r\n as the Windows end of line sequence being  
also treated as \n for compatibility this explains the current  
behavior in the GUI. ("\r", "\n", "\r\n" are equivalent, "\r\r" and "\n 
\r" ares equivalent to "\n\n").

We may change the behavior in the future as the compatibility may not  
be as important anymore. As of the other codes, I'm not quite sure  
it's worth the hassle, but it could be done.
You'll have to tell us more about your settings - at least  
sessionInfo(), possibly Sys.getenv("R_GUI_APP_VERSION") and any other  
changes you made to your preferences manually. After selecting French  
language and French settings in the system preferences, I get correctly:

 > nonexistingvar
Erreur : objet "nonexistingvar" non trouv?

locale:
fr_FR.UTF-8/fr_FR.UTF-8/fr_FR.UTF-8/C/fr_FR.UTF-8/fr_FR.UTF-8

Cheers,
Simon