Learn R Programming

pacheck (version 0.2.2)

generate_cor: 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, digits = 3)

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.

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).

digits

integer. Number of decimals to display in correlation matrix. Default is 3.

Examples

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

Run the code above in your browser using DataLab