polygon.region: This function can be used to draw polygon based on x variable...

View source: R/polygon.region.R

polygon.regionR Documentation

This function can be used to draw polygon based on x variable and its range i.e. max and min or confidence interval

Description

This function can be used to draw polygon based on x variable and its range i.e. max and min or confidence interval

Usage

polygon.region(dat,x=x, x.type='as.numeric', polygon.draw=FALSE,...)

Arguments

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.

See Also

polygon.

Examples


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 


liuguofang/figsci documentation built on Nov. 24, 2023, 1:45 p.m.