makilabCor: Creates and exports a correlation matrix in a style...

View source: R/makilabCor.R

makilabCorR Documentation

Creates and exports a correlation matrix in a style consistent with the Maki Lab.

Description

Creates and exports a correlation matrix in a style consistent with the Maki Lab.

Usage

makilabCor(df, x, y, excel_export = FALSE, filename = NULL, sheetname = NULL)

Arguments

df

A data frame containing the variables you want to correlate.

x

A list of column names for the X axis.

y

A list of row names for the Y axis.

excel_export

A bool for whether or not you want an excel export.

filename

String of the filename to export to. Defaults to 'Data_YYYY-MM-DD.xlsx' where YYYY-MM-DD is today's date.

sheetname

A string to be used as the sheet name. Defaults to 'Corri' where i is the number of correlation sheets in the file.

Value

The table of correlation values.

Examples

data(iris)
library(makilab)
makilabCor(df = iris,
           x = c("Sepal.Width", "Sepal.Length"),
           y = c("Petal.Width", "Petal.Length", "Species")) # No export
makilabCor(df = iris,
           x = c("Sepal.Width", "Sepal.Length"),
           y = c("Petal.Width", "Petal.Length", "Species"),
           excel_export = TRUE) # Exports to excel

jvandoorn/makilab documentation built on Oct. 8, 2022, 3:33 a.m.