apa: APA Format

View source: R/apa.R

apaR Documentation

APA Format

Description

A function that formats decimals and leading zeroes for creating reports in scientific style.

Usage

apa(value, decimals = 3, leading = TRUE)

Arguments

value

A set of numeric values, either a single number, vector, or set of columns.

decimals

The number of decimal points desired in the output.

leading

Logical value: TRUE for leading zeroes on decimals and FALSE for no leading zeroes on decimals. The default is TRUE.

Details

This function creates "pretty" character vectors from numeric variables for printing as part of a report. The value can take a single number, matrix, vector, or multiple columns from a data frame, as long as they are numeric. The values will be coerced into numeric if they are characters or logical values, but this process may result in an error if values are truly alphabetical.

Examples

apa(value = 0.54674, decimals = 3, leading = TRUE)

doomlab/MOTE documentation built on April 17, 2022, 2:08 a.m.