[R] Output from function to a tcltk window

Peter Dalgaard p.dalgaard at biostat.ku.dk
Fri Feb 4 11:21:22 CET 2005


Henrik Andersson <h.andersson at nioo.knaw.nl> writes:

> I would like to display output to a tcltk window from e.g. a call to
> summary().
> 
> 
> 
> I tried to get something else than oneliners into a text window of the
> kind found at:
> 
> http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/TextWindows.html
> 
> But without success.

(Rcmdr must be doing this sort of thing already?)

I'd try this:

1) str <- paste(capture.output(summary(myfit),collapse="\n"))

2) clone the tkfaq demo (or one of James W.'s examples), but replace
   the line

   tkinsert(txt, "end", tkcmd("read", chn))

with 

   tkinsert(txt, "end", str)

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list