Quantile bands with optional smoothing, e.g. for visualizing simulations

1 2 3 4 |

`mat` |
Matrix or data.frame with columns of data |

`x` |
X-axis positions for each column. DEFAULT: 1:ncol(mat) |

`col` |
Vector of colors for each quantile group, recycled reversively if necessary. DEFAULT: rgb(0,0,1, alpha=c(0.5, 0.7)) |

`add` |
Add to existing plot? Allows to add to highly customized plot. DEFAULT: FALSE |

`main, xlab, ylab` |
plot labels. DEFAULT: "Quantile Bands", "" |

`probs` |
Probabilities passed to |

`na.rm` |
Remove NAs before computing |

`type` |
Which of the 9 |

`smooth` |
If(!is.na), |

`medargs` |
List of arguments passed to lines drawing |

`meanargs` |
List of arguments passed to lines drawing |

`txi` |
Text x position index (along columns of mat), recyled if necessary. NA to suppress. INTERNAL DEFAULT: middle of the plot for all. |

`textargs` |
List of arguments passed to |

`...` |
Further arguments passed to |

Quantiles of each column, invisible. Smoothed if `smooth`

is given!

This is the first version and is not tested very well yet.

Berry Boessenkool, berry-b@gmx.de, Sept 2014

`quantile`

, `quantileMean`

, `ciBand`

,
`polygon`

, https://cran.r-project.org/package=fanplot

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ```
neff <- t(replicate(n=30, sapply(1:400, function(nn) max(rnorm(nn))) ))
qB <- quantileBands(neff, x=1:400)
qB[,1:9]
quantileBands(neff, smooth=19, meanargs=list(col=2), txi=NA)
library(RColorBrewer)
quantileBands(neff, smooth=35, ylab="max of rnorm(n)",
xlab="sample size (n)", probs=0:10/10, col=brewer.pal(5,"BuGn"),
medargs=list(lwd=2), meanargs=list(col=2, lty=1), txi=c(40,50,60),
main="Maximum is an unsaturated statistic:\n it rises with sample size")
neff2 <- t(replicate(n=50, sapply(1:400, function(nn) mean(rnorm(nn))) ))
quantileBands(neff2, x=1:400, smooth=35, ylab="mean of rnorm(n)",
xlab="sample size (n)", probs=0:10/10, col=brewer.pal(5,"BuGn"),
txi=c(40,50,60), textargs=list(col="yellow"), medargs=list(lwd=2),
meanargs=list(col=2, lty=1), main="Mean converges to true population mean")
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.