In unices, I often used the following code id with bash:
Some Command 2>&1 | tee NameOfOutputFile.txt
"2> & 1" says to accept stderr and redirect it to stdout, after which it will be transmitted over the channel to "tee". I will experiment with this and other ways to register session R.
Another trick of unix is ββthe script command, which launches a subnet whose I / O (basically everything you enter and see in the response) is written to the specified file. Then exit the shell to finish the script. Again, subject to experimentation. Since the βshellβ is native to R, I will try first.
By the way, I selected these tricks using solaris, but they work with the same running Cygwin, unix emulator on Windows. Once upon a time, I discovered that my Cygwin images were more modern than institutional Solaris installations, because administrators had a lot more responsibility than just updating Solaris. Keep in mind that institutional machines were more powerful, so although Cygwin was more convenient, my personal machine just didn't make up for it.
AFTERNOTE:
I took the sample code from page 99 Shumway Time Series Analysis and its Applications with R examples . Here are the contents of the test file palette. R:
r plot(gnp) acf2(gnp, 50) gnpgr = diff(log(gnp)) # growth rate plot(gnpgr) acf2(gnpgr, 24) sarima(gnpgr, 1, 0, 0) # AR(1) sarima(gnpgr, 0, 0, 2) # MA(2) ARMAtoMA(ar=.35, ma=0, 10) # prints psi-weights quit("no") exit
I called it using:
script <palette.R
It captures commands from the R. palette and the corresponding output. Thus, it can be used for batch mode. For interactive mode, I'm going to go with my original plan and use the sink.
user36800
source share