mvplot: Visualize Multivariate Data

View source: R/03_bcnsm_distributions.R

mvplotR Documentation

Visualize Multivariate Data

Description

This function takes a matrix of quantitative data and generates a panel plot. The diagonal panels contains histograms for each variable, the lower panels display pairwise scatter plots, and the upper panels show some association measure, such as Kendall's tau, Spearman's rho, or Pearson correlation coefficient.

Usage

mvplot(y, method = c("kendall", "spearman", "pearson"), ...)

Arguments

y

a matrix or a data frame of quantitative data with variables in columns.

method

a character string indicating which association coefficient is to be computed for the upper panels of the plot. It is computed via [cor](stats::cor) function. One of "kendall" (default), "pearson", or "spearman" can be used.

...

arguments to be passed to or from methods.

Value

A panel plot displaying histograms on the diagonal, scatterplots in the lower panels, and Kendall's tau correlation in the upper panels.

Author(s)

Rodrigo M. R. Medeiros <rodrigo.matheus@live.com>

Examples

data <- data.frame(x1 = rnorm(1000),
                   x2 = rgamma(1000, 2, 4),
                   x3 = rbeta(1000, 4, 1),
                   x5 = rlnorm(1000, 3, 0.5))

mvplot(data)



rdmatheus/BCNSM documentation built on Feb. 8, 2024, 1:28 a.m.