plotCurve | R Documentation |
plotCurve() takes the data frame output of sca() and produces a ggplot of the independent variable's coefficient (as indicated in the call to sca()) across model specifications. By default a panel is added showing which control variables are present in each model. Note that the ggplot output by this function can only be further customized when 'plotVars = FALSE', i.e. when the control variable panel is not included.
plotCurve(
sca_data,
title = "",
showIndex = TRUE,
plotVars = TRUE,
ylab = "Coefficient",
plotSE = "bar"
)
sca_data |
A data frame returned by 'sca()' containing model estimates from the specification curve analysis. |
title |
A string to use as the plot title. Defaults to an empty string, '""'. |
showIndex |
A boolean indicating whether to label the model index on the the x-axis. Defaults to 'TRUE'. |
plotVars |
A boolean indicating whether to include a panel on the plot showing which variables are present in each model. Defaults to 'TRUE'. |
ylab |
A string to be used as the y-axis label. Defaults to '"Coefficient"'. |
plotSE |
A string indicating whether to display standard errors as bars or plots. For bars 'plotSE = "bar"', for ribbons 'plotSE = "ribbon"'. If any other value is supplied then no standard errors are included. Defaults to '"bar"'. |
If 'plotVars = TRUE' returns a grid grob (i.e. the output of a call to 'grid.draw'). If 'plotVars = FALSE' returns a ggplot object.
plotCurve(sca_data = sca(y="Salnty", x="T_degC", c("ChlorA", "O2Sat"),
data=bottles, progressBar=TRUE, parallel=FALSE),
title = "Salinity and Temperature Models",
showIndex = TRUE, plotVars = TRUE,
ylab = "Coefficient value", plotSE = "ribbon");
plotCurve(sca_data = sca(y="Salnty", x="T_degC",
c("ChlorA*O2Sat", "ChlorA", "O2Sat"),
data=bottles, progressBar=FALSE, parallel=FALSE),
showIndex = TRUE, plotVars = TRUE,
plotSE = "ribbon");
plotCurve(sca_data = sca(y="Salnty", x="T_degC",
c("ChlorA*NO3uM", "O2Sat", "ChlorA", "NO3uM"),
data=bottles,
progressBar = TRUE, parallel = TRUE, workers=2),
plotSE="");
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.