(Internal) create a tidy dataframe of correlations suitable for plotting

gather_cor(data, cor_method = "pearson",
  na_action = "pairwise.complete.obs")

Arguments

data

data.frame

cor_method

correlation method to use, from cor: "a character string indicating which correlation coefficient (or covariance) is to be computed. One of "pearson" (default), "kendall", or "spearman": can be abbreviated."

na_action

The method for computing covariances when there are missing values present. This can be "everything", "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs" (default). This option is taken from the cor function argument use.

Value

tidy dataframe of correlations

Examples

gather_cor(airquality)
#> row_1 row_2 value #> 1 Ozone Ozone 1.000000000 #> 2 Solar.R Ozone 0.348341693 #> 3 Wind Ozone -0.601546530 #> 4 Temp Ozone 0.698360342 #> 5 Month Ozone 0.164519314 #> 6 Day Ozone -0.013225647 #> 7 Ozone Solar.R 0.348341693 #> 8 Solar.R Solar.R 1.000000000 #> 9 Wind Solar.R -0.056791666 #> 10 Temp Solar.R 0.275840271 #> 11 Month Solar.R -0.075300764 #> 12 Day Solar.R -0.150274979 #> 13 Ozone Wind -0.601546530 #> 14 Solar.R Wind -0.056791666 #> 15 Wind Wind 1.000000000 #> 16 Temp Wind -0.457987879 #> 17 Month Wind -0.178292579 #> 18 Day Wind 0.027180903 #> 19 Ozone Temp 0.698360342 #> 20 Solar.R Temp 0.275840271 #> 21 Wind Temp -0.457987879 #> 22 Temp Temp 1.000000000 #> 23 Month Temp 0.420947252 #> 24 Day Temp -0.130593175 #> 25 Ozone Month 0.164519314 #> 26 Solar.R Month -0.075300764 #> 27 Wind Month -0.178292579 #> 28 Temp Month 0.420947252 #> 29 Month Month 1.000000000 #> 30 Day Month -0.007961763 #> 31 Ozone Day -0.013225647 #> 32 Solar.R Day -0.150274979 #> 33 Wind Day 0.027180903 #> 34 Temp Day -0.130593175 #> 35 Month Day -0.007961763 #> 36 Day Day 1.000000000