Skip to contents

Print the corr_coef object in two ways. By default, the results are shown in the R console. The results can also be exported to the directory into a *.txt file.

Usage

# S3 method for class 'corr_coef'
print(x, export = FALSE, file.name = NULL, digits = 3, ...)

Arguments

x

An object of class corr_coef

export

A logical argument. If TRUE, a *.txt file is exported to the working directory.

file.name

The name of the file if export = TRUE

digits

The significant digits to be shown.

...

Options used by the tibble package to format the output. See tibble::formatting() for more details.

Author

Tiago Olivoto tiagoolivoto@gmail.com

Examples

# \donttest{
library(metan)
sel <- corr_coef(data_ge2, EP, EL, CD, CL)
print(sel)
#> ---------------------------------------------------------------------------
#> Pearson's correlation coefficient
#> ---------------------------------------------------------------------------
#>       EP    EL    CD    CL
#> EP 1.000 0.263 0.175 0.391
#> EL 0.263 1.000 0.912 0.255
#> CD 0.175 0.912 1.000 0.300
#> CL 0.391 0.255 0.300 1.000
#> ---------------------------------------------------------------------------
#> p-values for the correlation coefficients
#> ---------------------------------------------------------------------------
#>          EP       EL       CD       CL
#> EP 0.00e+00 8.92e-04 2.88e-02 4.55e-07
#> EL 8.92e-04 0.00e+00 1.97e-61 1.29e-03
#> CD 2.88e-02 1.97e-61 0.00e+00 1.39e-04
#> CL 4.55e-07 1.29e-03 1.39e-04 0.00e+00
#> 
#> 
#> 
# }