[R] ?plot: Add an example on how to plot functions to the help of `plot`.
Bert Gunter
gunter.berton at gene.com
Wed Jul 27 22:26:07 CEST 2011
Paul:
No such change is needed. You do not understand S3 methods. See
?plot.default and read about S3 methods (e.g. in the tutorial
Introduction to R or the Language manual).
-- Bert
On Wed, Jul 27, 2011 at 12:30 PM, Paul Menzel
<paulepanter at users.sourceforge.net> wrote:
> Dear R folks,
>
>
> currently the section Examples contains the following as an example on
> how to plot a “normal” function.
>
> plot(sin, -pi, 2*pi)
>
> Since it does not contain the argument for the function it would be
> helpful to add for example the following.
>
> ## plots the graph of f(x) = x**2 with f(x) ∈ [1, 10]
>
> curve(x**2, 1, 10)
>
> ## plots the graph of f(x) = x**3 with f(x) ∈ [1, 10] and adds it to an already existing plot
>
> curve(x**3, 1, 10, add=T)
>
> ## plots the graph of f(x) = x**4 connected by lines and adds it to an already existing plot
>
> lines(x, x**4, add=T)
>
> `curve` and `lines` could be also added to the section See Also.
>
>
> Thanks,
>
> Paul
>
> ______________________________________________
> R-help at r-project.org 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.
>
>
--
"Men by nature long to get on to the ultimate truths, and will often
be impatient with elementary studies or fight shy of them. If it were
possible to reach the ultimate truths without the elementary studies
usually prefixed to them, these would not be preparatory studies but
superfluous diversions."
-- Maimonides (1135-1204)
Bert Gunter
Genentech Nonclinical Biostatistics
More information about the R-help
mailing list