Report r(x,y) correlation in markdown APA style
apa.r(
.data,
.x,
.y,
alternative = "two.sided",
method = "pearson",
show.r = TRUE,
show.conf.interval = NULL,
show.N = NULL,
show.p = NULL,
show.statistic = NULL,
number.decimals = NULL,
number.decimals.p = NULL
)R Markdown text
A data frame or data frame extension (e.g., tibble)
Name of column in data frame
Name of column in data frame
Alternative hypothesis to pass to alternative argument of cor.test. Default is "two.sided"
Calculation method to pass to alternative argument of cor.test. Default is "pearson"
Show correlation or not (TRUE/FALSE)
Show confidence interval or not (TRUE/FALSE). Default behavior is TRUE.
Show sample size or not (TRUE/FALSE). Default behavior is TRUE.
Show p-value or not (TRUE/FALSE). Default behavior is TRUE.
Show test statistic or not (TRUE/FALSE). Default behavior is TRUE.
Number of decimals used in output (excluding p-value)
Number of decimals used in output for p-value
library(dplyr)
attitude %>% apa.r(rating, advance)
Run the code above in your browser using DataLab