in_paren: Replace Parentheses with Brackets

View source: R/in_paren.R

in_parenR Documentation

Replace Parentheses with Brackets

Description

Takes a single character or a list of characters and replaces parentheses with brackets. Can be used to prepare a string of statistics (e.g. containing degrees of freedom) for reporting within parentheses.

Usage

in_paren(x)

Arguments

x

Character. Single character or list of characters.

Value

An object of the same type as x, where all parentheses have been replaced by brackets.

See Also

apa_print()

Examples

t_stat <- t.test(extra ~ group, data = sleep)
t_test_res <- apa_print(t_stat)
in_paren(t_test_res$stat)
in_paren(t_test_res[1:3])

papaja documentation built on Oct. 30, 2024, 9:09 a.m.