Skip to content
Prev 389219 / 398506 Next

[EXT] Re: adding results to plot

This is pretty kludgy but ...

res.p <- capture.output(res) ? # creates a list of what goes to the screen
res.pl <- '' "?? # initialize res.pl
res.nul <- sapply(res.p,function(x.c) res.pl <<- 
paste(res.pl,res.c,sep='\n'))? # adds the list items separated by a line 
feed
text(x, y, res.pl, pos=4, cex=mycex)

This will replicate the print object for the t.test that goes to the 
screen so you can add it to a plot. One note, the output of several 
lines will be left justified at the x-location but centered vertically 
on the y-location. Experimental with the cex setting to fit it on your 
plot. It will also put two blank lines above and one below so you might 
strip those out for better positioning

Best regards

David Stevens
On 9/16/2021 8:59 AM, Bert Gunter wrote: