<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin-top:0cm;
        margin-right:0cm;
        margin-bottom:8.0pt;
        margin-left:0cm;
        line-height:105%;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Consolas","serif";
        color:black;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-NZ" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Syed,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Yes, Tim’s approach is one way to get what you need. It works well and delivers what you are asking for.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">There are several others. A more traditional way is to use:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">"%InstallPath%\bin\i386\r.exe" CMD BATCH --vanilla –quiet MyScript.R<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">You’ll need to put in the path to your version of R where I have %InstallPath%, but do leave the quote marks alone. The i386 can be changed to the 64 bit folder if needed. The --vanilla ensures the session used
 to process your script file (MyScript.R) is a clean one, and the --quiet stops the welcome message being printed in the output file. The default output file will be called MyScript.Rout that is the output file is just the input filename with the extension
 altered. It is just a text file and can be opened in notepad or any other text editor of your choosing.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">You can add those switches to the line offered by Tim too by the way.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">In version 0.23.1  of the BrailleR package I added a MakeBatch() function to generate the right command line in a batch file for a given filename. I’m close  to rolling the changes in BrailleR out to CRAN. In
 fact I really ought to get on with that ASAP. The development version is available via GitHub though. Instructions for installing from GitHub can be found on the BrailleR homepage at<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><a href="http://R-Resources.massey.ac.nz/BrailleR/">http://R-Resources.massey.ac.nz/BrailleR/</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Jonathan<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal">
<b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> BlindRUG [mailto:blindrug-bounces@nfbnet.org]
<b>On Behalf Of </b>Tim in 't Veld via BlindRUG<br>
<b>Sent:</b> Thursday, 17 March 2016 7:44 a.m.<br>
<b>To:</b> Blind R Users Group<br>
<b>Cc:</b> Tim in 't Veld<br>
<b>Subject:</b> Re: [BlindRUG] Input output via batch file question<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Dear Syed , <br>
Below is the batch file (a single line) I use to save the output of a script "in.r" to file "out.txt". Make sure to adapt the path for the R executable and ensure to run this batch file from the same directory where your "in.r" is located.
<br>
<br>
"C:\Program Files\R\R-3.2.3\bin\x64\Rterm.exe" --no-save < in.R > out.txt <br>
<br>
Mind the quotes and the > sign in the above line, both are essential components. <br>
Hope this helps,<br>
Tim <br>
On 3/16/2016 7:31 PM, Syed Rizvi via BlindRUG wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hello All, <o:p></o:p></p>
<p class="MsoNormal">I am a student at the Louisiana Center for the Blind and am trying to learn how to use R for my career in business information systems.
<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I am trying to construct a batch file that will take my R script input file, run it, and save the output in a text file.
<o:p></o:p></p>
<p class="MsoNormal">I have tried using all the other resources but I can’t find syntax specific to what I am trying to do. As of right now in my batch file I have the path statement at the top to define my environment variable. Now what I am trying to do is
 pass my input to RTerm and save the output. <o:p></o:p></p>
<p class="MsoNormal">If anyone can guide me in this, I would be extremely appreciative.
<o:p></o:p></p>
<p class="MsoNormal">Thank you, <o:p></o:p></p>
<p class="MsoNormal">Syed Rizvi <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal">
<span style="font-size:12.0pt;font-family:"Times New Roman","serif""><br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>BlindRUG mailing list<o:p></o:p></pre>
<pre><a href="mailto:BlindRUG@nfbnet.org">BlindRUG@nfbnet.org</a><o:p></o:p></pre>
<pre><a href="http://nfbnet.org/mailman/listinfo/blindrug_nfbnet.org">http://nfbnet.org/mailman/listinfo/blindrug_nfbnet.org</a><o:p></o:p></pre>
<pre>To unsubscribe, change your list options or get your account info for BlindRUG:<o:p></o:p></pre>
<pre><a href="http://nfbnet.org/mailman/options/blindrug_nfbnet.org/tim%40dvlop.nl">http://nfbnet.org/mailman/options/blindrug_nfbnet.org/tim%40dvlop.nl</a><o:p></o:p></pre>
<pre>The list archive can be viewed at:<o:p></o:p></pre>
<pre><a href="http://www.nfbnet.org/pipermail/blindrug_nfbnet.org">http://www.nfbnet.org/pipermail/blindrug_nfbnet.org</a><o:p></o:p></pre>
<pre>More information and useful links about using R as a blind person can be obtained at:<o:p></o:p></pre>
<pre><a href="http://R-Resources.massey.ac.nz">http://R-Resources.massey.ac.nz</a><o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Look for help using R commands by reading the accessible e-book "Let's Use R Now" compiled by Jonathan Godfrey at:<o:p></o:p></pre>
<pre><a href="http://R-Resources.massey.ac.nz/lurn/front.html">http://R-Resources.massey.ac.nz/lurn/front.html</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal">
<span style="font-size:12.0pt;font-family:"Times New Roman","serif""><o:p> </o:p></span></p>
</div>
</body>
</html>