[R] Using system to run a stand alone program that requires input in Windows

Dr Carbon drcarbon at gmail.com
Thu Jul 14 20:47:34 CEST 2005


Well, I'm confused because I tried to cook up an exaple and it appears
to work as I think it should. If I have a simple script named
myInput.bat:
@echo off
echo Enter y
set /p Input=
if /i "%Input%"=="y" (goto Proceed)
echo y not entered
exit /b
:Proceed
echo y entered

and a text file with just a y in it called y.txt then this works:
 > system("myInput < y.txt", show.output.on.console = T)
Enter y
y entered
 > 

So, I'm baffled.




More information about the R-help mailing list