Other things to look at for this would be to try simply pipping the stdout and stderr right from the R heredoc into a log file I haven't tried this yet but it will probably work too. Rscript -slave -no-save -no-restore - "$test1" test.log If you are able to use the bash shell, you can consider simply running the R code from within a bash script and piping the stdout and stderr streams to a file. 'help.start()' for an HTML browser interface to help. Type 'demo()' for some demos, 'help()' for on-line help, or 'citation()' on how to cite R or R packages in publications. Type 'contributors()' for more information and R is a collaborative project with many contributors. Natural language support but running in an English locale Type 'license()' or 'licence()' for distribution details. You are welcome to redistribute it under certain conditions. R is free software and comes with ABSOLUTELY NO WARRANTY. = begin contents of script.Rout = R version 3.1.0 () - "Spring Dance"Ĭopyright (C) 2014 The R Foundation for Statistical Computing You should also get a file named test. and you'll get this text on screen (we'll never get rid of this line on screen, as it is sent to the Console and cannot be redirected): This text goes to the Console. The default name of the log file has "out" appended to the extension, i.e., script.Rout Redirect 'all' output to a single file: Run: test.bat > test.txt 2>&1. The trailing "&" is optional and runs the command in the background. = begin contents of script.R = a " in windows), run $ R CMD BATCH script.R & If you have access to a command line, you might prefer running your script from the command line with R CMD BATCH. We can export the SQL Server query results to a txt file by executing the following cmdlets: Invoke-Sqlcmd -InputFile 'C:\sql\myquery.sql' Out-File -filePath 'C:\sql\powershelloutput.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |