Dewez Thomas
2004-Jul-28 14:23 UTC
[R] using Rterm under cygwin, no possiblity to delete characters
Dear R-users, When I call Rterm from cygwin, I have no options but typing the exact syntax the first time. If I happen to hit the "delete" key (backspace), R dies when I press enter saying : Error: ... (error concerning the function on the last line of text) Execution halted Perhaps some of you have experienced this and found work arounds? One has to be pretty good to type without ever committing mistakes! By the way, I am running Cygwin (cygwin_NT-5.0 release 1.5.10(0.116/4/2), I reinstalled everything fresh last week) on Win 2k and R 1.9.1. Although some of you find cygwin inefficient in many ways, I don't have the option to migrate to Linux. Cheers, Thomas *** Le contenu de cet e-mail et de ses pi??ces jointes est destin?? ?? l'usage exclusif du (des) destinataire(s) express??ment d??sign??(s) comme tel(s). En cas de r??ception de cet e-mail par erreur, le signaler ?? son exp??diteur et ne pas en divulguer le contenu. L'absence de virus a ??t?? v??rifi?? ?? l'??mission du message. Il convient n??anmoins de v??rifier l'absence de corruption ?? sa r??ception. The contents of this email and any attachments are confidential. They are intended for the named recipient(s) only. If you have received this email in error please notify the system manager or the sender immediately and do not disclose the contents to anyone or make copies. eSafe scanned this email for viruses, vandals and malicious content. ***
Prof Brian Ripley
2004-Jul-28 14:34 UTC
[R] using Rterm under cygwin, no possiblity to delete characters
You have to call Rterm.exe *from a command shell*. `cygwin' is not a command shell, but a collection of tools that provides several such. So we can only guess at what you are using. Rterms runs satisfactorily in many shells (I use tcsh, others use Cygwin bash ...). This is all described in the README and rw-FAQ files, for example. On Wed, 28 Jul 2004, Dewez Thomas wrote:> Dear R-users, > > When I call Rterm from cygwin, I have no options but typing the exact syntax > the first time. If I happen to hit the "delete" key (backspace), R dies when > I press enter saying :backspace and delete are separate keys, so which did you mean?> Error: ... (error concerning the function on the last line of text) > Execution halted > > Perhaps some of you have experienced this and found work arounds? One has to > be pretty good to type without ever committing mistakes! > > By the way, I am running Cygwin (cygwin_NT-5.0 release 1.5.10(0.116/4/2), I > reinstalled everything fresh last week) on Win 2k and R 1.9.1. Although some > of you find cygwin inefficient in many ways, I don't have the option to > migrate to Linux.The alternative is to use a Windows-native shell, such as tcsh.exe. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Henrik Bengtsson
2004-Jul-28 15:04 UTC
[R] using Rterm under cygwin, no possiblity to delete characters
Hi. I used to run R under Cygwin for quite some time, but after, I think, R v1.8.1 or so, the problems started to show up. There has been some discussion about (recent) problems running R under Cygwin. Once problem was for instance that hitting Ctrl-C in R running Cygwin would bring you into a concurrent forked R and shell environment. Search the r-help archive for that discussion. Anyway, the final take home message, which was underlined by B. Ripley, was that R does *not* support Cygwin. For command line R, I run R in a specially setup Command prompt. It works fine indeed; Below is the bat-file that I use to initiate a new Command prompt to run Rterm in. If it does not run out of the box for you, it should not be hard to modify. Cheers Henrik Bengtsson @echo off rem ###################################################################### rem # Usage: RCMDprompt.bat [path] rem # rem # This script opens a MS-DOS prompt with a enviroment variables rem # set such that R can be ran and packages can be build. rem # If 'path' is given, the working directory will be set accordingly. rem # rem # NOTE: This scripts works even if Cygwin is installed. HOWEVER, you rem # can not have any Cygwin applications running (not even a shell or rem # XEmacs for Cygwin) at the same time you try to run RCMD. rem # rem # Requires: rem # To build and install packages two things must be installed, i.e. rem # exists in the PATH. First, the Rtools compilation [1,2] must exists. rem # The path (R_TOOLS) to it is set below. Second, Perl (must not be rem # Cygwin/Perl) must also exists. The path to it is set below. rem # rem # Reference: rem # [1] http://www.stats.ox.ac.uk/pub/Rtools/ rem # [2] http://www.murdoch-sutherland.com/Rtools/ rem # [3] Duncan Murdoch, Using MiKTeX with R for Windows, 2004. rem # http://www.murdoch-sutherland.com/Rtools/miktex.html rem # rem # Henrik Bengtsson, hb at maths.lth.se, March-June 2004. rem ###################################################################### rem # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rem # 1. "Global" environment variables rem # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rem # Short version of PROGRAMFILES, e.g. 'C:\Progra~1' instead of rem # 'C:\Program Files\', which contains spaces that are BAD for R & Co. rem # rem # On Windows XP and NT, variable substitution using 'for' can be used rem # to do this automatically from %ProgramFiles%. For details see rem # http://www.microsoft.com/windowsxp/home/using/productdoc/en/for.asp for %%v in ("%ProgramFiles%") do set PROGRAMFILES_SHORT=%%~sv rem # Set the main R directory set R_ROOT=%PROGRAMFILES_SHORT%\R rem # Set the R_HOME directory set R_HOME=%R_ROOT%\rw1090 rem # Set the HOME directory. This is the directory where R looks rem # for the .Rprofile and .Renviron files. See ?Startup. set HOME=%UserProfile% rem # Set TMPDIR to a temporary directory set TMPDIR=%TEMP% rem # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rem # 2. Setup the PATH rem # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rem # Clear the PATH (making the main Cygwin installation "invisible") path ; rem # Set the LaTeX directory rem # http://www.miktex.org/ path %SystemDrive%\texmf\miktex\bin;%PATH% rem # There are recent issues with MikTeX v2.4 and R. The problem occurs rem # because e-TeX is used instead of TeX. See [3] for details. rem # Try latex -version. If you see "MikTeX-e-TeX" then you should read rem # the instructions at [3]. rem # Set the Microsoft HTML Help Compiler directory rem # http://msdn.microsoft.com/library/tools/htmlhelp/chm/HH1Start.htm path %ProgramFiles%\HTML Help Workshop;%PATH% rem # Set the Perl directory rem # http://www.activestate.com/Products/ActivePerl/Download.html path %SystemDrive%\Perl\bin;%PATH% rem # Set the Rtools [1] directory rem # http://www.stats.ox.ac.uk/pub/Rtools/ path %R_ROOT%\Rtools;%PATH% rem # Set the R_HOME directory path %R_HOME%\bin;%PATH% rem # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rem # 3. Start the MSDOS prompt in the given directory rem # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rem # Change directory according to argument 1 cd /D "%1" rem # Start the MSDOS commando prompt "%SystemRoot%\system32\cmd.exe"> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Dewez Thomas > Sent: Wednesday, July 28, 2004 4:24 PM > To: 'r-help at stat.math.ethz.ch' > Subject: [R] using Rterm under cygwin, no possiblity to > delete characters > > > Dear R-users, > > When I call Rterm from cygwin, I have no options but typing > the exact syntax the first time. If I happen to hit the > "delete" key (backspace), R dies when I press enter saying : > > Error: ... (error concerning the function on the last line of > text) Execution halted > > Perhaps some of you have experienced this and found work > arounds? One has to be pretty good to type without ever > committing mistakes! > > By the way, I am running Cygwin (cygwin_NT-5.0 release > 1.5.10(0.116/4/2), I reinstalled everything fresh last week) > on Win 2k and R 1.9.1. Although some of you find cygwin > inefficient in many ways, I don't have the option to migrate to Linux. > > Cheers, > > Thomas > *** > Le contenu de cet e-mail et de ses pi??ces jointes est destin?? > ?? l'usage exclusif du > (des) destinataire(s) express??ment d??sign??(s) comme tel(s). > En cas de r??ception de cet > e-mail par erreur, le signaler ?? son exp??diteur et ne pas en > divulguer le contenu. > L'absence de virus a ??t?? v??rifi?? ?? l'??mission du message. Il > convient n??anmoins de > v??rifier l'absence de corruption ?? sa r??ception. > > The contents of this email and any attachments are > confidential. They are intended for > the named recipient(s) only. If you have received this email > in error please notify the > system manager or the sender immediately and do not disclose > the contents to > anyone or make copies. eSafe scanned this email for viruses, > vandals and malicious > content. > *** > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > >
Dewez Thomas
2004-Jul-29 12:28 UTC
[R] using Rterm under cygwin, no possiblity to delete characters
Dear Brian,> You have to call Rterm.exe *from a command shell*. `cygwin' is not a > command shell, but a collection of tools that provides > several such. So > we can only guess at what you are using. > > Rterms runs satisfactorily in many shells (I use tcsh, others > use Cygwin > bash ...). This is all described in the README and rw-FAQ files, > for example.Your confusion is all due to my inaccurate explanation. In fact, Rterm runs fine when running inside cygwin's bash window. I was running R from a bash shell inside GRASS 5.7. I didn't think GRASS was altering the bash response. Perhaps this is something Roger has come across before when developping the interface.> > When I call Rterm from cygwin, I have no options but typing > the exact syntax > > the first time. If I happen to hit the "delete" key > (backspace), R dies when > > I press enter saying : > > backspace and delete are separate keys, so which did you mean? >The error comes from hitting anything but a normal key ie arrow keys or backspace.> > Error: ... (error concerning the function on the last line of text) > > Execution halted > > > > Perhaps some of you have experienced this and found work > arounds? One has to > > be pretty good to type without ever committing mistakes! > > > > By the way, I am running Cygwin (cygwin_NT-5.0 release > 1.5.10(0.116/4/2), I > > reinstalled everything fresh last week) on Win 2k and R > 1.9.1. Although some > > of you find cygwin inefficient in many ways, I don't have > the option to > > migrate to Linux. > > The alternative is to use a Windows-native shell, such as tcsh.exe.Thanks for your ideas Thomas *** Le contenu de cet e-mail et de ses pi??ces jointes est destin?? ?? l'usage exclusif du (des) destinataire(s) express??ment d??sign??(s) comme tel(s). En cas de r??ception de cet e-mail par erreur, le signaler ?? son exp??diteur et ne pas en divulguer le contenu. L'absence de virus a ??t?? v??rifi?? ?? l'??mission du message. Il convient n??anmoins de v??rifier l'absence de corruption ?? sa r??ception. The contents of this email and any attachments are confidential. They are intended for the named recipient(s) only. If you have received this email in error please notify the system manager or the sender immediately and do not disclose the contents to anyone or make copies. eSafe scanned this email for viruses, vandals and malicious content. ***
Dewez Thomas
2004-Jul-30 09:37 UTC
[R] using Rterm under cygwin, no possiblity to delete characters
Dear R-users, Thanks to Roger Bivand, it appears that the real problem is coming from the way R talks to X11 under cygwin. Both other invocations of Rterm, either in a bash window without Xwindow capability or from the DOS command, work just fine. Rterm breaks down every time it is invoked from a bash shell inside an Xwindow session. The symptoms are the following: + No popup window appears when invoking help() or plot() commands + Instead, the Windows task bar shows an R icon, but this icon cannot be restore to full screen + Rterm dies when hitting return after correcting typos the error message then is: --- Error: syntax error Execution halted --- This suggests that Rterm is by-passing fvwm2 and the X11 environment to talk to windows directly. This is also probably the reason why terminal properties are forgotten when just using Rterm for typing commands. It forgets that it was invoked from bash and responds to all the keys pressed. If typos are corrected with backspace, Rterm reads is a gibberish string made of printable and non printable characters causing it to misunderstand the command and fail. Any clues as to what I should do? I insist on using R in an Xwindow session because I want to take advantage of the R/GRASS module and compute stats on GIS layers. Cheers, Thomas *** Le contenu de cet e-mail et de ses pi??ces jointes est destin?? ?? l'usage exclusif du (des) destinataire(s) express??ment d??sign??(s) comme tel(s). En cas de r??ception de cet e-mail par erreur, le signaler ?? son exp??diteur et ne pas en divulguer le contenu. L'absence de virus a ??t?? v??rifi?? ?? l'??mission du message. Il convient n??anmoins de v??rifier l'absence de corruption ?? sa r??ception. The contents of this email and any attachments are confidential. They are intended for the named recipient(s) only. If you have received this email in error please notify the system manager or the sender immediately and do not disclose the contents to anyone or make copies. eSafe scanned this email for viruses, vandals and malicious content. ***
Dewez Thomas
2004-Jul-30 13:43 UTC
[R] using Rterm under cygwin, no possiblity to delete characters
Dear all again, Here is a wrap-up of the fact finding mission Roger and I led over the last two days (see his reply below my email). The issue was the following: --------------------------- 1. Rterm breaks down when invoked from Xwindow under Cygwin. This is a typical Cygwin problem and does not seem to occur on other Unix/Linux systems. 2. Rterm breaking down in Xwindow had implications for using the R/GRASS interface. R/GRASS would die as soon as an unrecognized function was entered. Solution -------- 1. To execute Rterm in the Cygwin environment, use a terminal window (bash in my case) directly under windows and NOT in an Xwindow environment. Running Rterm under Xwindow is the cause of the problem. 2. For subsequent questions concerning R/Grass interface. I sucessfully managed to run Rterm within GRASS in the following manner: 1. Start an Xwindow session 2. Back in Windows, start a bash terminal window (the bright green and black icon) 3. Start GRASS in this new bash window (see below for setting this up correctly) 4. Inside GRASS start Rterm (type just Rterm at the prompt) If you call the help and graphics functions of R, new R windows will pop up in Windows, and if you want graphics display for GRASS (e.g. d.mon start=x0; d.rast myGISlayer), they will appear in the Xwindow session. This is a hybrid system but it seems to work. To make sure that GRASS runs inside the bash terminal window, alter the GRASS_GUI setting of the file .grassrc57 (it is to be found in the directory that cygwin recognises as your home). In .grassrc57, there is a setting called GRASS_GUI and usually set to tcltk GRASS_GUI: tcltk The option we want is "text" instead of "tcltk" With this setting you will be able to operate GRASS with command lines in the bash terminal and see graphics output displayed in the Xwindow session. By the way, invoking Grass in the terminal also seems to work in GRASS57. I didn't do anything else than install the precompiled binaries for Windows following the recommended procedure. Inside the R/GRASS interface, I stumbled on other problems (concerning gmeta() command failing to find mapsets). I still need to figure this out. More later and thank you very much for the brilliant help! Thomas> -----Message d'origine----- > De: Roger Bivand [mailto:Roger.Bivand at nhh.no] > Date: vendredi 30 juillet 2004 13:26 > ??: Dewez Thomas > Objet: RE: [R] using Rterm under cygwin, no possiblity to delete > characters > > > Thomas, > > Yes and no. I'm refering to > > http://grass.itc.it/grass50/binary/windows_cygnus/wingrass_generic/ > > which appears to have stopped at 5.0.2. Subsequent Cygwin > compiles: 5.0.3, > 5.3, and 5.7 all require an X-server for the d.* commands. > The question is > whether you can run the GRASS programs that do not need a > running X-server > under Cygwin under straight Windows (Cygwin bash running in a Windows > command line window, I think). I also think Peter Dalgaard is > right that > Rterm expects to be used as batch, rather than interactively, > and will > then halt at errors (although I have run it interactively > from a Windows > command line window and within Cygwin bash). I think you will make > progress if you can avoid all graphics (X11) in using the R/GRASS > interface, and not using an X11 windows manager, just > straight Windows. > > It would be useful to document this, as other people are > likely to run > into this trying to run the interface on 5.7 under Cygwin. > > Best wishes, > > Roger > > On Fri, 30 Jul 2004, Dewez Thomas wrote: > > > Roger, > > > > Not sure to understand you statement > > > Rterm will run for the > > > Generic GRASS Cygwin version (I have tried with GRASS 5.0.2), but > > > not pretending to do X11 under Cygwin. > > > > This may be the solution, but how does one run Generic > GRASS cygwin? Can you > > call display procedures with commands like: d.mon start=x0 > ; d.his h_map=dem > > i_map=slope? I am confused about this and always assumed > that Grass needed > > to be inside an Xwindow session to use graphics displays. > > > > Your suggestion will probably save my day if you could just > precise it a > > little. Thanks! > > > > Thomas > > *** > > Le contenu de cet e-mail et de ses pi??ces jointes est > destin?? ?? l'usage exclusif du > > (des) destinataire(s) express??ment d??sign??(s) comme tel(s). > En cas de r??ception de cet > > e-mail par erreur, le signaler ?? son exp??diteur et ne pas > en divulguer le contenu. > > L'absence de virus a ??t?? v??rifi?? ?? l'??mission du message. > Il convient n??anmoins de > > v??rifier l'absence de corruption ?? sa r??ception. > > > > The contents of this email and any attachments are > confidential. They are intended for > > the named recipient(s) only. If you have received this > email in error please notify the > > system manager or the sender immediately and do not > disclose the contents to > > anyone or make copies. eSafe scanned this email for > viruses, vandals and malicious > > content. > > *** > > > > -- > Roger Bivand > Economic Geography Section, Department of Economics, > Norwegian School of > Economics and Business Administration, Breiviksveien 40, > N-5045 Bergen, > Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93 > e-mail: Roger.Bivand at nhh.no > >*** Le contenu de cet e-mail et de ses pi??ces jointes est destin?? ?? l'usage exclusif du (des) destinataire(s) express??ment d??sign??(s) comme tel(s). En cas de r??ception de cet e-mail par erreur, le signaler ?? son exp??diteur et ne pas en divulguer le contenu. L'absence de virus a ??t?? v??rifi?? ?? l'??mission du message. Il convient n??anmoins de v??rifier l'absence de corruption ?? sa r??ception. The contents of this email and any attachments are confidential. They are intended for the named recipient(s) only. If you have received this email in error please notify the system manager or the sender immediately and do not disclose the contents to anyone or make copies. eSafe scanned this email for viruses, vandals and malicious content. ***