[R] ?plot: Add an example on how to plot functions to the help of `plot`.

Paul Menzel paulepanter at users.sourceforge.net
Wed Jul 27 21:30:52 CEST 2011


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110727/841f31c9/attachment.bin>


More information about the R-help mailing list