generate_cor: Generate correlation matrix

View source: R/fct_inspection.R

generate_corR Documentation

Generate correlation matrix

Description

This function generates the correlation matrix of input and output values of a probabilistic analysis.

Usage

generate_cor(df, vars = NULL, figure = FALSE)

Arguments

df

a dataframe. This dataframe contains the probabilistic inputs and outputs of the health economic model.

vars

a vector of strings. Contains the name of the variables to include in the correlation matrix. Default is NULL meaning all variables will be included.

figure

logical. Should the correlation matrix be plotted in a figure? Default is FALSE (no figure generated).

Value

If figure == FALSE: a matrix with summary statistics for the selected inputs and outputs. If figure == TRUE: a tile ggplot2 of the correlation matrix.

Examples

# Generating summary data of all inputs using the example dataframe
data(df_pa)
generate_cor(df_pa)

Xa4P/pacheck documentation built on April 14, 2025, 1:51 p.m.