View source: R/bruceR-stats_1_basic.R
Corr | R Documentation |
Correlation analysis.
Corr( data, method = "pearson", p.adjust = "none", all.as.numeric = TRUE, digits = 2, nsmall = digits, file = NULL, plot = TRUE, plot.range = c(-1, 1), plot.palette = NULL, plot.color.levels = 201, plot.file = NULL, plot.width = 8, plot.height = 6, plot.dpi = 500 )
data |
Data frame. |
method |
|
p.adjust |
Adjustment of p values for multiple tests:
|
all.as.numeric |
|
digits, nsmall |
Number of decimal places of output. Default is |
file |
File name of MS Word ( |
plot |
|
plot.range |
Range of correlation coefficients for plot. Default is |
plot.palette |
Color gradient for plot. Default is |
plot.color.levels |
Default is |
plot.file |
|
plot.width |
Width (in "inch") of the saved plot. Default is |
plot.height |
Height (in "inch") of the saved plot. Default is |
plot.dpi |
DPI (dots per inch) of the saved plot. Default is |
Invisibly return the correlation results obtained from
psych::corr.test()
.
Describe
Corr(airquality) Corr(airquality, p.adjust="bonferroni") d = as.data.table(psych::bfi) added(d, { gender = as.factor(gender) education = as.factor(education) E = .mean("E", 1:5, rev=c(1,2), range=1:6) A = .mean("A", 1:5, rev=1, range=1:6) C = .mean("C", 1:5, rev=c(4,5), range=1:6) N = .mean("N", 1:5, range=1:6) O = .mean("O", 1:5, rev=c(2,5), range=1:6) }) Corr(d[, .(age, gender, education, E, A, C, N, O)])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.