Parse Credible Set Correlations from extract_cs_info() Output
Source:R/univariate_rss_diagnostics.R
parse_cs_corr.RdThis function takes the output from `extract_cs_info()` and expands the `cs_corr` column into multiple columns, preserving the original order of correlations. It also calculates maximum and minimum correlation values for each Credible Set.
Value
A data frame with the original columns from the input, plus:
- cs_corr_1, cs_corr_2, ...
Individual correlation values, with column names based on their position in the original string
- cs_corr_max
Maximum absolute correlation value (excluding 1)
- cs_corr_min
Minimum absolute correlation value
Details
The function splits the `cs_corr` column, which typically contains correlation values separated by '|', into individual columns. It preserves the order of these correlations, allowing for easy interpretation in a matrix-like format.
Note
- This function converts the input to a data frame if it isn't already one. - It handles cases where correlation values might be missing or not in the expected format. - The function assumes that correlation values of 1 represent self-correlations and excludes these when calculating max and min correlations.