[R] Function to save results
ericjberger at gmail.com
Wed Nov 1 14:24:26 CET 2017
1. sink() does not return a value. There is on point to set attr <-
sink(...). Just give the command sink("C://....etc")
2. to complete the saving to the file you must give a second sink command
with no argument: sink()
So your code would be (pseudo-code, not actual code)
sink( "filename" )
do something that prints output which will be captured by sink
On Wed, Nov 1, 2017 at 1:32 PM, Priya Arasu via R-help <r-help at r-project.org
> Hi,I want the results to be saved automatically in a output text file
> after the script has finished running.
> I used the sink function in the following example, but the results file
> (output.txt) was empty.
> net <- loadNetwork("C://Users//Priya//Desktop//Attractor analysis_all
> First I loaded theinput file for which I want to identify attractors
> attr <- sink("C://Users//Priya//Desktop//Attractor analysis_all
> genes//synaptogenesis//output.txt")# used the sink function to save the
> results from attr function
> attr <- getAttractors(net, type="asynchronous")# then ran the script for
> identifying attractors
> Is there any function to save the results before setting the script to
> run, so that results are automatically saved in a text file after the
> script has finished running?
> Thank youPriya
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/
> and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
More information about the R-help