Home   Publications   Resources   My CV   Contact   RSSRSS

Advanced Graphics I

June 23, 2013 by Daniel Marcelino | Filed under Tutorials.

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:

← Previous

Tags: ,

4 Responses to “Advanced Graphics I”

  1. Kenn says:

    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. YR says:

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