/in.progress/auteurExtended/man/trace.plot.Rd

http://github.com/eastman/auteur · Unknown · 36 lines · 34 code · 2 blank · 0 comment · 0 complexity · f5fd060f584565d7dd578314816a7188 MD5 · raw file

  1. \name{trace.plot}
  2. \alias{trace.plot}
  3. \title{plotting of Bayesian posterior samples}
  4. \description{Compares posterior densities of Bayesian estimates}
  5. \usage{trace.plot(obj, col, alpha, lwd = 1, hpd = 0.95, bars = TRUE, legend.control = list(plot = TRUE, pos = NA, cex = 1, pt.cex = 1, pch = 22, title = ""), truncate = list(min = NA, max = NA), xlim = list(min = NA, max = NA), ...)}
  6. \arguments{
  7. \item{obj}{a vector or dataframe (where each column is separately plotted);
  8. names of columns are retrieved if a legend is to be generated}
  9. \item{col}{either empty or a vector of colors with one for each column in the \code{obj}}
  10. \item{alpha}{a degree of color translucence to be used for shaded densities, where 1 is opaque, 0 is clear}
  11. \item{lwd}{line width used for highest-density range and density outlines (see \code{\link{par}})}
  12. \item{hpd}{either \code{NULL} or a value between 0 and 1, corresponding to the width of the highest
  13. density region to be shaded}
  14. \item{bars}{a logical specifier which, if \code{bars=TRUE}, outlines the width of the high density region}
  15. \item{legend.control}{if \code{plot=TRUE}, a legend is generated (see \code{\link{legend}} for details concerning this list)}
  16. \item{truncate}{if \code{min} and (or) \code{max} are defined, values below and (or) above the truncation
  17. point are removed prior to computation of the highest density region and prior to plotting}
  18. \item{xlim}{if \code{min} and (or) \code{max} are defined, values below and (or) above the limit(s) are
  19. excluded from the plot without further corrupting the data}
  20. \item{\dots}{further arguments to be passed to \code{\link{plot}}}
  21. }
  22. \author{JM Eastman}
  23. \seealso{\code{\link[diversitree]{profiles.plot}}, upon which this function is largely based}
  24. \examples{
  25. # construct and plot a dataframe of three 'traces', excluding the largest values
  26. d=data.frame(list(rnorm(n=1000,mean=9,sd=5)),list(rnorm(n=1000,mean=1.5,sd=2)),list(rnorm(n=1000,mean=-0.5,sd=1.5)))
  27. names(d)=letters[1:3]
  28. trace.plot(obj=d, xlim=list(max=10), col=c("maroon","gray","purple"), alpha=0.3, lwd=2)
  29. dev.new()
  30. # construct and plot a dataframe of two 'traces' using a log scale
  31. d=data.frame(list(rlnorm(n=1000,meanlog=1,sdlog=0.5)),list(rlnorm(n=1000,meanlog=1.5,sdlog=0.6)))
  32. names(d)=letters[1:2]
  33. trace.plot(obj=d,col=c("maroon","purple"),alpha=0.3,log="x")
  34. }