as_cor_tbl: Coerce to a cor_tbl object

Description Usage Arguments Value Author(s) Examples

View source: R/as-cor-tbl.R

Description

Functions to coerce a object to cor_tbl if possible.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
as_cor_tbl(x, ...)

## S3 method for class 'matrix'
as_cor_tbl(x, ...)

## S3 method for class 'data.frame'
as_cor_tbl(x, ...)

## S3 method for class 'correlate'
as_cor_tbl(x, extra.mat = list(), ...)

## S3 method for class 'rcorr'
as_cor_tbl(x, ...)

## S3 method for class 'corr.test'
as_cor_tbl(x, ...)

## S3 method for class 'mantel_tbl'
as_cor_tbl(x, byrow = TRUE, ...)

## S3 method for class 'pro_tbl'
as_cor_tbl(x, byrow = TRUE, ...)

## Default S3 method:
as_cor_tbl(x, ...)

Arguments

x

any R object.

...

extra params passing to cor_tbl.

extra.mat

any other matrix-like data with same dimmsion as x.

byrow

a logical value indicating whether arrange the 'spec' columns on y axis.

Value

a cor_tbl object.

Author(s)

Houyun Huang, Lei Zhou, Jian Chen, Taiyun Wei

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
cor(mtcars) %>% as_cor_tbl()
correlate(mtcars, cor.test = TRUE) %>% as_cor_tbl()
correlate(mtcars, type = "upper") %>% as_cor_tbl()
## Not run: 
## S3 method for rcorr object
require(Hmisc)
rcorr(mtcars) %>% as_cor_tbl()

## S3 method for corr.test object
require(psych)
corr.test(mtcars) %>% as_cor_tbl()

## End(Not run)

houyunhuang/ggcor documentation built on July 22, 2020, 8:31 p.m.