View source: R/blav_object_methods.R
plot.blavaan | R Documentation |
Convenience functions to create plots of blavaan objects, via the bayesplot package.
## S3 method for class 'blavaan'
plot(x, pars = NULL, plot.type = "trace", showplot = TRUE, ...)
x |
An object of class |
pars |
Parameter numbers to plot, where the numbers correspond to the order of parameters as reported by |
plot.type |
The type of plot desired. This should be the name of a |
showplot |
Should the plot be sent to the graphic device? Defaults to |
... |
Other arguments sent to the bayesplot function. |
In previous versions of blavaan, the plotting functionality was
handled separately for JAGS and for Stan (using plot functionality in
packages runjags and rstan, respectively). For uniformity, all
plotting functionality is now handled by bayesplot. If users desire
additional functionality that is not immediately available, they can extract the matrix of MCMC draws via as.matrix(blavInspect(x, 'mcmc'))
.
An invisible ggplot object that, if desired, can be further customized.
## Not run:
data(HolzingerSwineford1939, package = "lavaan")
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9 '
fit <- bcfa(HS.model, data = HolzingerSwineford1939)
# trace plots of free loadings
plot(fit, pars = 1:6)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.