How to invoke an R script as shown below
scan()
on windows? When using Ror Rscriptnothing is read. With Rscriptor littler(as on Linux) the script works as expected.
R
Rscript
littler
# Doesn't work because stdin is already redirected R --no-save < test.R # Works on Linux, doesn't on Windows Rscript test.R # Works on Linux, doesn't exist in Windows r test.R
Is it even possible to achieve this without changing the R code?
Perhaps it is connected: why in Windows there is no switch --interactive?
--interactive
So, as we discussed in the comments and with @nograpes confirmation, you can use the following:
scan(file("stdin"), what=character())
script scan() , script .Ctrl + Z, Windows (Ctrl + D Mac).
Source: https://habr.com/ru/post/1622163/More articles:Gulp watch multiple folders - javascriptHow to fix rsLogonFailed error message while running report - sql-serverHow to read data from a serial port in R - windowsHow to find out all signed filters on a PUB server? - zeromqChange string resource with flavor / debug-build - androidAngular scope and ng-click / ng-show to set multiple divs - angularjsChecking a Social Security number that accepts dashes, spaces, or spaces - regexHow to handle a frame in the page object model - javaInsert multiple rows through a variable - sqlIn gdb, how do I set a breakpoint on any line that has a specific word? - cAll Articles