
Last chance! 50% off unlimited learning
Sale ends in
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
)
numeric
numeric, a list of preferred integer denominators to conform to, default is numeric(0)
.
numeric, maximum number of steps, default is 10.
numeric, maximum denominator when the loop of trial should stop, default is 500.
logical, if specified, convert to character of p/q, default is FALSE
.
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.
# NOT RUN {
pq1 <- ecd.rational(2.5)
pq2 <- ecd.rational(1/250)
# }
Run the code above in your browser using DataLab