[R-SIG-Mac] R.app: Up-arrow yields incomplete command recall when # is in a character string

Steven McKinney smckinney at bccrc.ca
Fri Jun 6 05:33:31 CEST 2008


Something is amiss with the mechanism that
recalls the last command when the user hits
the up-arrow key in the R.app GUI listener:


> formatC(0.0059999, digits=2,format="fg",flag="#")
[1] "0.0060"
> ## Hit the up-arrow to recall last command - 
> ## note that not all of the command appears
> formatC(0.0059999, digits=2,format="fg",flag="


Looks as if some code needs to be added
to differentiate 
# outside of quotes as a comment character 
from 
# inside quotes as a portion of a character string,
which I'll respectfully ask more talented programmers
than myself to fix in their copious spare time,
with many thanks in advance.



> sessionInfo()
R version 2.7.0 (2008-04-22) 
powerpc-apple-darwin8.10.1 

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

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

other attached packages:
[1] lme4_0.999375-14  Matrix_0.999375-9 lattice_0.17-6   

loaded via a namespace (and not attached):
[1] grid_2.7.0
> 

R.app GUI 1.24 (5102), S.Urbanek & S.M.Iacus, © R Foundation for Statistical Computing, 2008



It works in a Mac terminal shell R session

> formatC(0.0059999, digits=2,format="fg",flag="#")
[1] "0.0060"
> ## Hit the up-arrow to recall last command - 
> ## all of the command appears
> formatC(0.0059999, digits=2,format="fg",flag="#")
[1] "0.0060"
> sessionInfo()
R version 2.7.0 (2008-04-22) 
powerpc-apple-darwin8.10.1 

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

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


and inside an Emacs ESS inferior buffer running R

> formatC(0.0059999, digits=2,format="fg",flag="#")
[1] "0.0060"
> formatC(0.0059999, digits=2,format="fg",flag="#")
[1] "0.0060"
> sessionInfo()
R version 2.7.0 (2008-04-22) 
powerpc-apple-darwin8.10.1 

locale:
C

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

other attached packages:
[1] lattice_0.17-6

loaded via a namespace (and not attached):
[1] Matrix_0.999375-9 grid_2.7.0        lme4_0.999375-14  nlme_3.1-88      
> 



Best

Steve McKinney



More information about the R-SIG-Mac mailing list