fractions | R Documentation |
Find rational approximations to the components of a real numeric object using a standard continued fraction method.
Calls MASS::fractions()
, see details there.
fractions(x, cycles = 10, max.denominator = 2000, ...)
x |
Any object of mode numeric. Missing values are now allowed. |
cycles |
The maximum number of steps to be used in the continued fraction approximation process. |
max.denominator |
An early termination criterion. If any partial denominator exceeds max.denominator the continued fraction stops at that point. |
... |
arguments passed to or from other methods. |
An object of class "fractions". A structure with .Data component the same as the input numeric x, but with the rational approximations held as a character vector attribute, "fracs". Arithmetic operations on "fractions" objects are possible.
X <- matrix(runif(25), 5, 5)
fractions(X) #;)
fractions(solve(X, X/5))
fractions(solve(X, X/5)) + 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.