Skip to contents

Correlations coefficients can be displayed between all numeric variables or selected numeric variables. Defaults to pearson correlation coefficient. To change the method, specify 'method' as 'kendall', or 'spearman'. Both a plot and table output are generated and saved to the `output` folder.

Usage

corr_out(
  dat,
  project,
  variables = "all",
  method = "pearson",
  show_coef = FALSE
)

Arguments

dat

Primary data containing information on hauls or trips. Table in FishSET database contains the string 'MainDataTable'.

project

String, project name.

variables

A character string of variables to include. Defaults to "all" numeric variables.

method

A character string indicating which correlation coefficient is to be computed. One of "pearson" (default), "kendall", or "spearman".

show_coef

Logical, whether to include the correlation coefficients on the correlation plot. Only coefficients with a p-value of less than or equal to 0.05 are shown.

Details

Returns Pearson's correlation coefficient between numeric variables in plot and table format. Output saved to output folder.

Examples

if (FALSE) {
corr_out(pollockMainDataTable, 'pollock', 'all')
}