plotControlDistributions: Plots control variable distributions.

View source: R/functions.R

plotControlDistributionsR Documentation

Plots control variable distributions.

Description

plotControlDistributions() plots the distribution of coefficients for each control variable included in the model specifications.

Usage

plotControlDistributions(sca_data, title = "", type = "density")

Arguments

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, '""'.

type

A string indicating what type of distribution plot to produce. When 'type = "density"' density plots are produced. When 'type = "hist"' or 'type = "histogram"' histograms are produced. Defaults to '"density"'.

Value

A ggplot object.

Examples

plotControlDistributions(sca_data = sca(y="Salnty", x="T_degC",
                                    controls = c("ChlorA", "O2Sat"),
                                    data = bottles,
                                    progressBar = TRUE, parallel = FALSE),
                         title = "Control Variable Distributions")
plotControlDistributions(sca_data = sca(y = "Salnty", x="T_degC",
                                    controls = c("ChlorA*O2Sat"),
                                    data = bottles,
                                    progressBar = FALSE, parallel = FALSE),
                         type = "hist")
plotControlDistributions(sca_data = sca(y = "Salnty", x = "T_degC",
                                    controls = c("ChlorA*NO3uM",
                                                 "O2Sat*NO3uM"),
                                    data = bottles, progressBar = TRUE,
                                    parallel = TRUE, workers = 2),
                         type = "density")

speccurvieR documentation built on Oct. 10, 2024, 1:08 a.m.