This function produces the matrix of correlations between all quantitative variables in a dataframe.

1 | ```
cor_matrix(X,type="pearson")
``` |

`X` |
A data frame |

`type` |
Either |

This function filters out any non-numerical variables and provides correlations only between quantitative variables. Best for datasets with only a few variables. The correlation matrix is returned (with class `matrix`

).

Adam Petrie

Introduction to Regression and Modeling

`cor`

1 2 3 4 5 | ```
data(TIPS)
cor_matrix(TIPS)
data(AUTO)
cor_matrix(AUTO,type="spearman")
``` |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.