sample_size: [INTERNAL] Sample size for correlation computation

View source: R/network_generation.R

sample_sizeR Documentation

[INTERNAL] Sample size for correlation computation

Description

[INTERNAL] Depending on how missing data is handled in correlation matrix computation, the number of samples used is returned. If 'all.obs' is specified the number of rows (i.e. samples) of the original data is returned. If 'pairwise.complete.obs' is specified the crossproduct of a matrix indicating the non-NA values is returned as matrix. This implementation was adopted from corAndPvalue.

Usage

sample_size(measurement_data, handling_missing_data)

Arguments

measurement_data

[data.frame] Data frame containing the respective raw data (e.g. mRNA expression data, protein abundance, etc.) to the adjacency matrix. Analyzed components (e.g. genes) in rows, samples (e.g. patients) in columns.

handling_missing_data

["all.obs"|"pairwise.complete.obs"] Specifying the handling of missing data during correlation matrix computation. (default: all.obs)

Value

For 'all.obs' returns an integer indicating the number of samples in the supplied matrix (i.e. number of rows). For 'pairwise.complete.obs' returns a matrix in the same size of the correlation matrix indicating the number of samples for each correlation calculation.

Source

Method to calculate samples in 'pairwise.complete.obs' adopted and improved from corAndPvalue


DrDimont documentation built on Sept. 23, 2022, 5:06 p.m.