corRows: Correlate rows of a numeric matrix

View source: R/corRows.R

corRowsR Documentation

Correlate rows of a numeric matrix

Description

corRows is a simple function to perform a pairwise correlation between rows of a numeric matrix by calling stats::cor() on the transposed input matrix x.

Usage

corRows(
  x,
  y = NULL,
  use = "pairwise.complete.obs",
  method = c("pearson", "kendall", "spearman"),
  ...
)

Arguments

x

numeric matrix.

y

not supported (ignored).

use

see information for parameter use in stats::cor(). Defaults to use = "pairwise.complete.obs".

method

see information for parameter method in stats::cor().

...

additional parameters (ignored).

Value

matrix with correlation coefficients between rows in x.

Author(s)

Johannes Rainer

Examples


## Define a simple numeric matrix
x <- rbind(
    c(12, 34, 231, 234, 9, 5, 7),
    c(900, 900, 800, 10, 12, 9, 4),
    c(25, 70, 400, 409, 15, 8, 4),
    c(12, 13, 14, 15, 16, 17, 18),
    c(14, 36, 240, 239, 12, 7, 8)
    )

corRows(x)

corRows(x, method = "spearman")

rformassspectrometry/MsFeatures documentation built on April 21, 2023, 6:20 a.m.