This is an example on programming with S3 method. The results from this: plotting p.d.f. curve and shading the curve for selected interval(s). The functions are provided in pdfShading.R. Run the following command at R prompt (> ):
source("http://www.stat.wmich.edu/wang/R/egs/Pdf/pdfShading.R")The R Data image will be saved (since the last line of the codes does just that).
The R codes in PdfDemo.R will produce 12 (acrobat) PDF files (Example01.pdf, ..., Example12.pdf) as results of individual examples. Examples are separable by copy/paste each code chunk. To run it all, do
source("http://www.stat.wmich.edu/wang/R/egs/Pdf/PdfDemo.R")Use acrobat reader to view each graph.
The R codes in Prop1.R will produce 5 (acrobat) PDF files (Prop01.pdf, ..., Prop05.pdf). Programming on graphical elements in these plot is evidenced. Again, do
The session as seen in the screen snapshot below will produce graphics as below. Note that, in the session, after submitting
> from <- locator(1)the control is handed over to the graphics, asking user to identify a point (starting point of the arrow in this case). Left click mouse at an appropriate point.