[R] adding results to plot

PIKAL Petr petr@p|k@| @end|ng |rom prechez@@cz
Thu Sep 16 17:16:04 CEST 2021


Thanks, 
I will try to elaborate on it.

Best regards.
Petr

> -----Original Message-----
> From: R-help <r-help-bounces using r-project.org> On Behalf Of Kimmo Elo
> Sent: Thursday, September 16, 2021 4:45 PM
> To: r-help using r-project.org
> Subject: Re: [R] adding results to plot
> 
> Hi!
> 
> Maybe with this:
> 
> text(x=0.6, y=1.2, paste0(capture.output(res), collapse="\n"), adj=0)
> 
> HTH,
> 
> Kimmo
> 
> to, 2021-09-16 kello 14:12 +0000, PIKAL Petr kirjoitti:
> > 	Virhe vahvistaessa allekirjoitusta: Virhe tulkittaessa Dear all
> >
> > I know I have seen the answer somewhere but I am not able to find it.
> > Please
> > help
> >
> > > plot(1,1)
> > > res <- shapiro.test(rnorm(100))
> > > res
> >
> >         Shapiro-Wilk normality test
> >
> > data:  rnorm(100)
> > W = 0.98861, p-value = 0.5544
> >
> > I would like to add whole res object to the plot.
> >
> > I can do it one by one
> > > text(locator(1), res$method)
> > > text(locator(1), as.character(res$p.value))
> > ...
> > But it is quite inconvenient
> >
> > I could find some way in ggplot world but not in plain plot world.
> >
> > Best regards
> > Petr
> >
> > ------=_NextPart_000_00C9_01D7AB15.A6E04EE0--
> > ______________________________________________
> > R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > 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.
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.


More information about the R-help mailing list