[ top | up ]

Rational Approximations to in Fraction Form

Usage

fractions(x, ...)

Arguments

x Array to be approximated.
... Optional additional parameters to be passed to rat(x, ...)

Value

A character array of the same shape as x of rational approximations in fraction form. e.g 0.28571429 -> "2/7".

See Also

rational, rat.

Examples

# somewhat pointless..
    x <- rep(1:7,1:7)/7
#compare:
    table(x)
#with:
    table(fractions(x))