Leo Gürtler
2007-Jan-26 01:51 UTC
[R] CGIwithR and visible output of 'invisible(capture.output(library(...)))'
Dear alltogether, I want to use CGIwithR in conjunction with R2HTML. A small example called 'test.R': ##### #! /usr/bin/R invisible(capture.output(library(R2HTML))) HTML(summary(as.numeric(scanText(formData$numbers))), file=stdout()) ##### The script gets its input via 'CGIwithR.cgi' and contains the variable "numbers." The 'HTML' output (-> summary() in this example) goes well, but the loading of the R2HTML library is also printed (!) in the resulting html page. As I took the example from the original CGIwithR examples and I also read the manpages of invisible() and capture.output(), I do not find a logical reason why this still happens. Deleting the line with "invisible ... library().." and adding 'library(R2HTML)' to .Rprofile does not solve the problem. I use ubuntu edgy, R Version 2.3.1 (2006-06-01) THANKS! best wishes, leo PS: the output is (uncut) <----> MiniUnz 1.01b, demo of zLib + Unz package written by Gilles Vollant more info at http://www.winimage.com/zLibDll/unzip.html /usr/local/lib/R/site-library/R2HTML/output/R2HTMLstuff.zip opened extracting: ASCIIMathML.js extracting: factor.gif extracting: gridR2HTML.css extracting: gridR2HTML.js extracting: numeric.gif extracting: Pastel.css extracting: R2HTML.css extracting: R2HTMLlogo.gif creating directory: runtime/ creating directory: runtime/lib/ extracting: runtime/lib/grid.js extracting: runtime/readme.txt creating directory: runtime/styles/ creating directory: runtime/styles/classic/ extracting: runtime/styles/classic/gecko.xml extracting: runtime/styles/classic/grid.css extracting: runtime/styles/classic/grid.png extracting: runtime/styles/classic/icons.png extracting: runtime/styles/classic/loading.gif creating directory: runtime/styles/flat/ extracting: runtime/styles/flat/gecko.xml extracting: runtime/styles/flat/grid.css extracting: runtime/styles/flat/grid.png extracting: runtime/styles/flat/icons.png extracting: runtime/styles/flat/loading.gif creating directory: runtime/styles/xp/ extracting: runtime/styles/xp/gecko.xml extracting: runtime/styles/xp/grid.css extracting: runtime/styles/xp/grid.png extracting: runtime/styles/xp/icons.png extracting: runtime/styles/xp/loading.gif extracting: SciViews.css extracting: tablesort.htc </---->
Eric
2007-Jan-27 04:18 UTC
[R] CGIwithR and visible output of 'invisible(capture.output(library(...)))'
library(R2HTML, verbose = FALSE) Leo G?rtler wrote:> Dear alltogether, > > I want to use CGIwithR in conjunction with R2HTML. > > A small example called 'test.R': > > ##### > > #! /usr/bin/R > invisible(capture.output(library(R2HTML))) > HTML(summary(as.numeric(scanText(formData$numbers))), file=stdout()) > > ##### > > The script gets its input via 'CGIwithR.cgi' and contains the variable > "numbers." > > The 'HTML' output (-> summary() in this example) goes well, but the > loading of the R2HTML library is also printed (!) in the resulting html > page. > > As I took the example from the original CGIwithR examples and I also > read the manpages of invisible() and capture.output(), I do not find a > logical reason why this still happens. > > Deleting the line with "invisible ... library().." and adding > 'library(R2HTML)' to .Rprofile does not solve the problem. > > I use ubuntu edgy, R Version 2.3.1 (2006-06-01) > > THANKS! > > best wishes, > > leo > > > PS: the output is (uncut) > > <----> > MiniUnz 1.01b, demo of zLib + Unz package written by Gilles Vollant more > info at http://www.winimage.com/zLibDll/unzip.html > /usr/local/lib/R/site-library/R2HTML/output/R2HTMLstuff.zip opened > extracting: ASCIIMathML.js extracting: factor.gif extracting: > gridR2HTML.css extracting: gridR2HTML.js extracting: numeric.gif > extracting: Pastel.css extracting: R2HTML.css extracting: R2HTMLlogo.gif > creating directory: runtime/ creating directory: runtime/lib/ > extracting: runtime/lib/grid.js extracting: runtime/readme.txt creating > directory: runtime/styles/ creating directory: runtime/styles/classic/ > extracting: runtime/styles/classic/gecko.xml extracting: > runtime/styles/classic/grid.css extracting: > runtime/styles/classic/grid.png extracting: > runtime/styles/classic/icons.png extracting: > runtime/styles/classic/loading.gif creating directory: > runtime/styles/flat/ extracting: runtime/styles/flat/gecko.xml > extracting: runtime/styles/flat/grid.css extracting: > runtime/styles/flat/grid.png extracting: runtime/styles/flat/icons.png > extracting: runtime/styles/flat/loading.gif creating directory: > runtime/styles/xp/ extracting: runtime/styles/xp/gecko.xml extracting: > runtime/styles/xp/grid.css extracting: runtime/styles/xp/grid.png > extracting: runtime/styles/xp/icons.png extracting: > runtime/styles/xp/loading.gif extracting: SciViews.css extracting: > tablesort.htc > </----> > > ______________________________________________ > 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 > and provide commented, minimal, self-contained, reproducible code. >