View source: R/polygon.region.R
polygon.region | R Documentation |
This function can be used to draw polygon based on x variable and its range i.e. max and min or confidence interval
polygon.region(dat,x=x, x.type='as.numeric', polygon.draw=FALSE,...)
dat |
the data comprises three columns.
x.type |
tranform the x variable based function provided.
polygon.draw |
polygon.draw whether draw a polygon on the plot. Default denotes without drawing polygons.
... |
further arguments pass to polygon
function.
polygon
.
dat <- data.frame(x = 1:10, y1 = rnorm(10,50,5), y2 =rnorm(10,30,3))
sapply(c('dplyr','plyr'),library,character.only = TRUE)
ylim <- range(as.vector(dat[,2:3]))
plot(dat[,'x'],type='n',ylim=ylim)
dat2 <- polygon.region(dat,x='x',polygon.draw = T,col='gray',border='gray')
dat2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.