[R] using Rterm under cygwin, no possiblity to delete characters

Henrik Bengtsson hb at maths.lth.se
Wed Jul 28 17:04:58 CEST 2004


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
> 
>




More information about the R-help mailing list