cor.matrix: Produce a correlation matrix.

View source: R/cor.matrix.R

cor.matrixR Documentation

Produce a correlation matrix.

Description

This function can be used to produce a correlation matrix which lower triangle is correlation coefficent and upper triangle is p values.

Usage

cor.matrix(dat,method='pearson')

Arguments

dat

an dataset with continuous variables.

method

The method used to calcuate cor test. Also the cormat function of pigrmess package

Examples



(out <- cor.matrix(iris[,-5]))

data2excel(dat = out, filename = 'correlation res.xlsx', sheetname = 'Sheet1', create = TRUE)


liuguofang/figsci documentation built on Nov. 24, 2023, 1:45 p.m.