View source: R/uncertMC_class.R
| plot.uncertMC | R Documentation | 
Plots for uncertainty evaluations produced by uncertMC or calls 
to uncert with method=MC.
## S3 method for class 'uncertMC'
plot(x, which = 1:2, 
    main=paste("Monte Carlo evaluation -",deparse(substitute(x))), 
    ask = prod(par("mfcol")) < length(which) && dev.interactive(), 
    caption = list("Histogram", "Q-Q plot", "Density", 
    "Correlation x-y", "Covariance x-y"), 
    xlab = paste(deparse(substitute(x)), "$y", sep = ""), 
    ..., cex.caption = 1, cex.main = 1.25, lwd.y = 2, col.y = 2, lty.y,
    col.qqline = NULL, lty.qqline = NULL, lwd.qqline = NULL)
x | 
 An object of class   | 
which | 
 Integer in 1:5; the particular variant(s) of plot required. 
A vector is permitted, in which case plots are produced in ascending order 
of   | 
main | 
 Main title for the plot  | 
ask | 
 logical; if 'TRUE', the user is _ask_ed before each plot, see 'par("ask=")'  | 
caption | 
 A list of captions for all the different plots.  | 
xlab | 
 x-axis label, currently passed only to the histogram plot.  | 
... | 
 Additional parameters passed to other functions. See details for which parameters are passed.  | 
cex.caption | 
 Expansion factor for individual plot captions; as   | 
cex.main | 
 Expansion factor for main title; as   | 
lwd.y, col.y, lty.y | 
 Line width and colour for the location line in the histogram and density plots. Setting lwd.y=0 suppresses the location line.  | 
col.qqline, lty.qqline, lwd.qqline | 
 Graphical parameters for the Q-Q line in the Q-Q plot.  | 
For uncert objects created with methods other than MC, the plot types are:
which=1A histogram of the MC replicates in x$MC$y, 
with optional line for x$MC$y. The histogram is produced using
hist.default
which=2A Q-Q plot of the MC replicates in x$MC$y, 
with Q-Q line. The plot uses qqnorm.default. If datax is not
present (in ‘...’), it is set to TRUE.
which=3A density plot of the MC replicates in x$MC$y.
The plot calls density.default to calculate the density and 
plot.density to produce the plot.
which=4A bar plot of cor(x_i,y) if x$y
is present. Any correlation method supported by stats::cor may 
be included in ‘...’ (e.g as method="pearson".
which=5A bar plot of cov(x_i,y) if x$y
is present. Any correlation method supported by stats::cov may 
be included in ‘...’ (e.g as method="pearson".
Values outside 1:5 are silently ignored.
Parameters in ‘...’ are passed to the various plot methods or calculations called. Only those parameters relevant to a given plot are passed to each calculation or plotting function, so ‘...’ can include any parameter accepted by any of the functions called.
For the x-y correlation and x-y covariance plot, values in x$cor.xy are 
used if available. If not, stats::cor or stats::cov is called on values 
in x$MC$y and x$MC$x if the latter is available 
(i.e. uncertMC was called with keep.x=TRUE). If neither 
x$cor.xy nor x$MC$x is present, or if method is 
unknown, the plot is skipped with a warning.
plot.uncertMC invisibly returns NULL.
S. L. R. Ellison, s.ellison@lgcgroup.com
None.
uncertMC-class, hist, 
qqnorm, qqline, 
density, plot.density
  expr <- expression(a/(b-c))
  x <- list(a=1, b=3, c=2)
  u <- lapply(x, function(x) x/20)
  set.seed(403)
  u.invexpr<-uncertMC(expr, x, u, distrib=rep("norm", 3), B=999, keep.x=TRUE )
  par(mfrow=c(2,2))
  plot(u.invexpr, which=1:4, pch=20, method="k") 
                                # method="k" gives Kendall correlation 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.