Calculate Correlation between Two Vectors
correlation_calculate.RdThis function calculates the Spearman (default) or Pearson correlation coefficient and its associated p-value between two vectors. It automatically handles missing values.
Arguments
- vector_x
A numeric vector.
- vector_y
A numeric vector of the same length as
vector_x.- method
A character string specifying the correlation method ("spearman" or "pearson"). Defaults to "spearman".
- ...
Pass to
cor.test.
See also
correlation_draw for plotting correlation results.