polygon Polygon is a such handy function in R for drawing beautiful charts where we can select regions (polygons) of the surface. It's quite useful for indicating confidence regions of parameters, predictions for time-series, or areas under distributions:

4 Thoughts on “Advanced Graphics I

  1. Kenn on June 24, 2013 at 8:22 pm said:

    The following lines are not polite!

    # rm(list = ls()) # clear objects
    # graphics.off() # close graphics windows

    If I want to try out your code and I already have an R session open then the last thing I want is first destroying the results of my previous work. Although every sensible person would first open a new empty session for trying out a code found from a random blog, you can't count on it. And in that case, rm(list=ls()) would be useless anyway. This shows your attitude towards your readers: you seem to think that everything they do is worthless when compared to your precious code.

    And what if I send you the code starting with:

    # unlink("C:/", recursive = TRUE, force=TRUE)
    # to have a clear starting point

    Would that be nice? Uh?

  2. Just add box() at the end of the script as the polygon overlaps with the x-axis ;-)

Post Navigation