Thorstensen Nicolas
2005-Jun-15 15:53 UTC
[R] suppress output of neural network for use in Sweave
Hi! How can I suppress the output of the function nnet in the library(nnet) ? I get the following output : > nn = nnet(x, y, size=5, maxit=40, linout=TRUE); # weights: 16 initial value 33.511291 iter 10 value 5.792440 iter 20 value 5.279584 iter 30 value 4.800890 iter 40 value 4.593410 final value 4.593410 stopped after 40 iterations Since I train many networks and use Sweave I don??t want the output in the latex code. So how can I suppress this output? thx jeff
Barry Rowlingson
2005-Jun-15 16:23 UTC
[R] suppress output of neural network for use in Sweave
Thorstensen Nicolas wrote:> Hi! > > How can I suppress the output of the function nnet in the library(nnet) ??nnet suggests adding trace=FALSE to the arguments. In other cases if functions dont have this sort of option then on a Unix box you can wrap your function calls in sink("/dev/null") [do stuff] sink() to send output to a black hole. Not sure what the Windows equivalent is. Baz
could you set trace = FALSE in the nnet(). On 6/15/05, Thorstensen Nicolas <thorstensen at gmx.net> wrote:> Hi! > > How can I suppress the output of the function nnet in the library(nnet) ? > > I get the following output : > > > nn = nnet(x, y, size=5, maxit=40, linout=TRUE); > # weights: 16 > initial value 33.511291 > iter 10 value 5.792440 > iter 20 value 5.279584 > iter 30 value 4.800890 > iter 40 value 4.593410 > final value 4.593410 > stopped after 40 iterations > > Since I train many networks and use Sweave I don??t want the output in > the latex code. So how can I suppress this output? > > > thx > jeff > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >-- WenSui Liu, MS MA Senior Decision Support Analyst Division of Health Policy and Clinical Effectiveness Cincinnati Children Hospital Medical Center
Gabor Grothendieck
2005-Jun-15 23:39 UTC
[R] suppress output of neural network for use in Sweave
On 6/15/05, Barry Rowlingson <B.Rowlingson at lancaster.ac.uk> wrote:> Thorstensen Nicolas wrote: > > Hi! > > > > How can I suppress the output of the function nnet in the library(nnet) ? > > ?nnet suggests adding trace=FALSE to the arguments. > > In other cases if functions dont have this sort of option then on a > Unix box you can wrap your function calls in sink("/dev/null") [do > stuff] sink() to send output to a black hole. Not sure what the Windows > equivalent is.A general way OS independent way to turn off output is via capture.output: invisible(capture.output(...whatever...))