parse_ab: Parses an ab setting into rational numbers a and b.

View source: R/genscore.R

parse_abR Documentation

Parses an ab setting into rational numbers a and b.

Description

Parses an ab setting into rational numbers a and b.

Usage

parse_ab(s)

Arguments

s

A string starting with "ab_", followed by rational numbers a and b separated by "_". a and b must be integers or rational numbers of the form "int/int". See examples.

Value

A list of the following elements:

a_numer

The numerator of a.

a_denom

The denominator of a.

b_numer

The numerator of b.

b_denom

The denominator of b.

Examples

parse_ab("ab_1_1") # gaussian: a = 1, b = 1
parse_ab("ab_2_5/4") # a = 2, b = 5/4
parse_ab("ab_5/4_3/2") # a = 5/4, b = 3/2
parse_ab("ab_3/2_0/0") # a = 3/2, b = 0/0 (log)
parse_ab("ab_1/2_0/0") # exp: a = 1/2, b = 0/0 (log)

genscore documentation built on May 29, 2024, 9 a.m.