Description Usage Arguments Value

View source: R/change_handlers.R

Changes an input correlation matrix in the way specified by a vector indicating which dimensions are affected and functions that draws changes to the standard deviations and correlations separately. If the correlations should be changed (draw_cor != NULL), all combinations of the indices in affected_dims have their correlations changed.

1 2 | ```
change_cor_mat(cor_mat, affected_dims, do_nearPD = TRUE,
draw_cor = NULL, draw_sd = NULL)
``` |

`cor_mat` |
A correlation matrix to be changed. |

`affected_dims` |
A vector specifying which dimensions should be changed. |

`do_nearPD` |
A logical indicating whether the Matrix::nearPD function should be run on the changed correlation matrix to find the closest positve definite matrix to it. Highly recommended, as the changes in correlation are not guaranteed to result in a valid correlation matrix. |

`draw_cor` |
A function to draw n (any natural number) changes in correlation from. |

`draw_sd` |
A function to draw n (any natural number) changes in standard deviation from. |

A changed correlation matrix, guaranteed to be positive definite if do_nearPD = TRUE.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.