[R] ?plot: Add an example on how to plot functions to the help of `plot`.
paulepanter at users.sourceforge.net
Wed Jul 27 22:53:05 CEST 2011
Am Mittwoch, den 27.07.2011, 13:26 -0700 schrieb Bert Gunter:
> 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  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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: This is a digitally signed message part
More information about the R-help