parse_ab | R Documentation |
Parses an ab setting into rational numbers a and b.
parse_ab(s)
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. |
A list of the following elements:
a_numer |
The numerator of |
a_denom |
The denominator of |
b_numer |
The numerator of |
b_denom |
The denominator of |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.