Description Usage Arguments Value Examples
Internal functions used in prep_init_list
and prep_prior_list
to extract
numerical values from priors. All use regular expressions as implemented
in the stringr
package, and all properly handle whitespace and
decimals.
extract_first
gets the first value, that is, the one after an open
parenthesis and before a comma.
extract_last
gets the last value, that is, the value after a comma and
before a close parenthesis.
extract_only
gets the only value from a distribution with one
parameter, that is, it gets the numbers between two parentheses.
1 2 3 4 5 | extract_first(string)
extract_last(string)
extract_only(string)
|
string |
The string to extract a value from. |
A numeric value.
1 2 3 4 5 6 | ## Not run:
extract_first("uniform(32,45)") # returns 32
extract_last("uniform(32,45)") # returns 45
extract_only("exponential(32)") # returns 32
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.