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

Description Usage Arguments Value Examples

View source: R/genscore.R

Description

Parses an ab setting into rational numbers a and b.

Usage

1

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

1
2
3
4
5
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 April 28, 2020, 1:06 a.m.