[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 22:53:05 CEST 2011


Dear Bert,


Am Mittwoch, den 27.07.2011, 13:26 -0700 schrieb Bert Gunter:
> Paul:
> No such change is needed.

Well the fact is, that I as a beginner was looking for who I could plot
normal functions, so one more example would have helped me.

> You do not understand S3 methods.

That is probably true.

> See ?plot.default and read about S3 methods (e.g. in the tutorial
> Introduction to R or the Language manual).

Searching for »s3 m« in [1] did not give me a good explanation. I have
not yet read the language manual.

By trial and error I still suggest to add the following.

        # Plot the graph of a function f(x) = x^3 with the points connected by lines.
        # If you want to plot the graph as a curve please look into `curve()`.
        y <- seq(1:5)
        plot(y, y**3, type="l")

This would have helped me as a beginner.


Thanks,

Paul


[1] http://cran.r-project.org/doc/manuals/R-intro.html
-------------- 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/d15b58bf/attachment.bin>


More information about the R-help mailing list