[BlindRUG] Running the Batch file - no output

Henrik Bengtsson henrik.bengtsson at gmail.com
Thu Apr 5 14:14:52 UTC 2018


When sourcing and R script from within R using:

    source("practice.R")

or running it in batch mode from the command line using:

    Rscript practice.R

you need to explicitly print objects in order for them to be outputted, e.g.

    print(x)

This also works in interactive mode, but since it is tedious to type, R is
designed to print all objects by default in interactive mode, i.e. typing
'x' plus ENTER at the R prompt is automatically turned into a print(x) by R.

Hope this helps

Henrik

On Thu, Apr 5, 2018, 03:46 Jude DaShiell via BlindRUG <blindrug at nfbnet.org>
wrote:

> Can you run that batch file through windows command line mode after
> deleting that myoutput file?  You may have better results.
> On Thu, 5 Apr
> 2018, Rohit Saraf via BlindRUG wrote:
>
> > Date: Thu, 5 Apr 2018 04:47:52
> > From: Rohit Saraf via BlindRUG <blindrug at nfbnet.org>
> > To: blindrug at nfbnet.org
> > Cc: Rohit Saraf <rohitsaraf15 at gmail.com>
> > Subject: [BlindRUG] Running the Batch file - no output
> >
> > Hi
> > I wrote the following code in the notepad file 'practice.R':
> > x=1:20
> > x
> >
> > Then I created a batch file with one line command expecting result in
> > a new txt file 'myoutput.txt'.
> > When i run the batch file through windows explorer, the new file
> > 'myoutput.txt' is created but there is no output in the file. In fact,
> > the file is empty.
> >
> > Could you please guide me to how to run a batch file properly.
> >
> >
> >
>
> --
>
>
> _______________________________________________
> BlindRUG mailing list
> BlindRUG at nfbnet.org
> http://nfbnet.org/mailman/listinfo/blindrug_nfbnet.org
> To unsubscribe, change your list options or get your account info for
> BlindRUG:
>
> http://nfbnet.org/mailman/options/blindrug_nfbnet.org/henrik.bengtsson%40gmail.com
> The list archive can be viewed at:
> http://www.nfbnet.org/pipermail/blindrug_nfbnet.org
> More information and useful links about using R as a blind person can be
> obtained at:
> http://R-Resources.massey.ac.nz
>
> Look for help using R commands by reading the accessible e-book "Let's Use
> R Now" compiled by Jonathan Godfrey at:
> http://R-Resources.massey.ac.nz/lurn/front.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nfbnet.org/pipermail/blindrug_nfbnet.org/attachments/20180405/65be4e40/attachment.html>


More information about the BlindRUG mailing list