apa.r: Report r(x,y) correlation in markdown APA style

View source: R/apa_correlation.R

apa.rR Documentation

Report r(x,y) correlation in markdown APA style

Description

Report r(x,y) correlation in markdown APA style

Usage

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
)

Arguments

.data

A data frame or data frame extension (e.g., tibble)

.x

Name of column in data frame

.y

Name of column in data frame

alternative

Alternative hypothesis to pass to alternative argument of cor.test. Default is "two.sided"

method

Calculation method to pass to alternative argument of cor.test. Default is "pearson"

show.r

Show correlation or not (TRUE/FALSE)

show.conf.interval

Show confidence interval or not (TRUE/FALSE). Default behavior is TRUE.

show.N

Show sample size or not (TRUE/FALSE). Default behavior is TRUE.

show.p

Show p-value or not (TRUE/FALSE). Default behavior is TRUE.

show.statistic

Show test statistic or not (TRUE/FALSE). Default behavior is TRUE.

number.decimals

Number of decimals used in output (excluding p-value)

number.decimals.p

Number of decimals used in output for p-value

Value

R Markdown text

Examples

library(dplyr)
attitude %>% apa.r(rating, advance)

apaText documentation built on May 31, 2023, 5:19 p.m.