autoplot.bayesmanecfit {bayesnec}R Documentation

autoplot.bayesmanecfit

Description

bayesnec standard ggplot2 plotting method.

Usage

## S3 method for class 'bayesmanecfit'
autoplot(
  object,
  ...,
  nec = TRUE,
  ecx = FALSE,
  force_x = FALSE,
  xform = NA,
  all_models = FALSE,
  plot = TRUE,
  ask = TRUE,
  newpage = TRUE,
  multi_facet = TRUE
)

Arguments

object

An object of class bayesmanecfit as returned by function bnec.

...

Additional arguments to be passed to ggbnec_data.

nec

Should NEC values be added to the plot? Defaults to TRUE.

ecx

Should ECx values be added to the plot? Defaults to FALSE.

force_x

A logical value indicating if the argument xform should be forced on the predictor values. This is useful when the user transforms the predictor beforehand (e.g. when using a non-standard base function).

xform

A function to apply to the returned estimated concentration values.

all_models

Should all individual models be plotted separately\ (defaults to FALSE) or should model averaged predictions be plotted instead?

plot

Should output ggplot output be plotted? Only relevant if all = TRUE and multi_facet = FALSE.

ask

Indicates if the user is prompted before a new page is plotted. Only relevant if plot = TRUE and multi_facet = FALSE.

newpage

Indicates if the first set of plots should be plotted to a new page. Only relevant if plot = TRUE and multi_facet = FALSE.

multi_facet

Should all plots be plotted in one single panel via facets? Defaults to TRUE.

Value

A ggplot object.

See Also

Other autoplot methods: autoplot.bayesnecfit()

Examples


library(brms)
library(bayesnec)
options(mc.cores = 2)
data(nec_data)

necs <- bnec(y ~ crf(x, c("nec3param", "nec4param")), data = nec_data,
             iter = 2e2, family = Beta(link = "identity"))
nec3param <- pull_out(necs, "nec3param")
autoplot(nec3param)
autoplot(nec3param, nec = FALSE)
autoplot(nec3param, ecx = TRUE, ecx_val = 50)

# plot model averaged predictions
autoplot(necs)
# plot all panels together
autoplot(necs, ecx = TRUE, ecx_val = 50, all_models = TRUE)
# plots multiple models, one at a time, with interactive prompt
autoplot(necs, ecx = TRUE, ecx_val = 50, all_models = TRUE,
         multi_facet = FALSE)


[Package bayesnec version 2.0.2 Index]