Tidy summarizes information about the components of a model.
A model component might be a single term in a regression, a single
hypothesis, a cluster, or a class. Exactly what tidy considers to be a
model component varies cross models but is usually self-evident.
If a model has several distinct types of components, you will need to
specify which components to return.

# S3 method for rcorr
tidy(x, diagonal = FALSE, ...)

## Arguments

x |
An `rcorr` object returned from `Hmisc::rcorr()` . |

diagonal |
Logical indicating whether or not to include diagonal
elements of the correlation matrix, or the correlation of a column with
itself. For the elements, `estimate` is always 1 and `p.value` is always
`NA` . Defaults to `FALSE` . |

... |
Additional arguments. Not used. Needed to match generic
signature only. **Cautionary note:** Misspelled arguments will be
absorbed in `...` , where they will be ignored. If the misspelled
argument has a default value, the default value will be used.
For example, if you pass `conf.lvel = 0.9` , all computation will
proceed using `conf.level = 0.95` . Additionally, if you pass
`newdata = my_tibble` to an `augment()` method that does not
accept a `newdata` argument, it will use the default value for
the `data` argument. |

## Details

Suppose the original data has columns A and B. In the correlation
matrix from `rcorr`

there may be entries for both the `cor(A, B)`

and
`cor(B, A)`

. Only one of these pairs will ever be present in the tidy
output.

## See also

## Value

A `tibble::tibble()`

with columns:

column1Name or index of the first column being described

column2Name or index of the second column being described

estimateThe estimated value of the regression term.

p.valueThe two-sided p-value associated with the observed statistic.

nNumber of observations used to compute the correlation

## Examples

#> Loading required package: Formula

#>
#> Attaching package: ‘Hmisc’

#> The following object is masked from ‘package:psych’:
#>
#> describe

#> The following object is masked from ‘package:survey’:
#>
#> deff

#> The following objects are masked from ‘package:dplyr’:
#>
#> src, summarize

#> The following objects are masked from ‘package:base’:
#>
#> format.pval, units

#> # A tibble: 1,326 x 5
#> column1 column2 estimate n p.value
#> <chr> <chr> <dbl> <int> <dbl>
#> 1 A B 0.0670 36 0.698
#> 2 A C 0.196 38 0.239
#> 3 B C 0.172 37 0.309
#> 4 A D -0.0397 36 0.818
#> 5 B D -0.00762 31 0.968
#> 6 C D 0.250 42 0.110
#> 7 A E 0.224 36 0.189
#> 8 B E 0.0700 35 0.690
#> 9 C E 0.211 46 0.159
#> 10 D E 0.147 40 0.364
#> # … with 1,316 more rows