Skip to main content

Convert the Alternative Hypothesis to the Values Used by Stats

Source: R/alternative.R

Description

Functions in this package use the values "two_sided", "greater", and "lesser" for the alternative hypothesis. The functions in the stats package (e.g., stats::binom.test()) use "two.sided", "greater", and "less". This helper validates the value and converts it.

Usage

convert_alternative(alternative, call = rlang::caller_env())

Arguments

Arguments Description
alternative A single character string: one of "two_sided", "greater", or "lesser".
call The execution environment used in error messages.

Value

A single character string: one of "two.sided", "greater", or "less".

Examples

convert_alternative("two_sided")
[1] "two.sided"
[1] "less"