Monthly Archives: May 2005

Creating shaded areas in R

May 12, 2005
Creating shaded areas in R

Sometimes we want to shade areas under a density on a graphic, for instance to illustrate a p-value or a region under the normal curve. Using the polygon() function from base R we can make graphics like the following one: How to do it First we have to plot the graphic of the function whose

Read more »