View source: R/ecd-rational-method.R
ecd.rational | R Documentation |
Convert a numeric x to rational p/q, which is then used for polynomial construction. It can be used for displaying the time as fraction of a year too.
ecd.rational( x, pref.denominator = numeric(0), cycles = 10, max.denominator = 500, as.character = FALSE )
x |
numeric |
pref.denominator |
numeric, a list of preferred integer denominators to conform to, default is |
cycles |
numeric, maximum number of steps, default is 10. |
max.denominator |
numeric, maximum denominator when the loop of trial should stop, default is 500. |
as.character |
logical, if specified, convert to character of p/q, default is |
vector of two integers, representing numerator and denominator. If as.character is true, then return character instead of the rational pair. If x is a vector and as.character is false, return a matrix of length(x) by 2.
pq1 <- ecd.rational(2.5) pq2 <- ecd.rational(1/250)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.