Converts a regular numeric matrix to a CorrelationMatrix S7 object with validation.
Examples
corr_mat <- matrix(c(1, 0.3, 0.3, 1), nrow = 2)
corr_obj <- as_correlation_matrix(corr_mat, n_hypotheses = 1, n_analyses = 2)
print(corr_obj)
#> <wpgsd::CorrelationMatrix>
#> @ matrix : num [1:2, 1:2] 1 0.3 0.3 1
#> @ n_hypotheses: int 1
#> @ n_analyses : int 2
#> @ column_names: chr [1:2] "H1_A1" "H1_A2"
