On my old beat-up TI-83 I can get a reduced fraction representation of a rational real number with the following syntax.
.14>Frac 7/50
Is there a similar syntax, function, or CRAN package that will allow me to do this in R?
Data Visualization using R Programming In R, we can use fractions function of MASS package to convert a decimal value or a vector of decimal values to fractional form. To do so, we just need to pass the value in fractions function as fractions(“Decimal_value or Vector_Of_Decimal_Values”).
Well remember that above, x was originally set equal to 2.666666 via x=2.666666, and now we have that x is also equal to 24/9, so that means 2.666666=24/9..and there's 2.666666 written as a fraction!
fractions() in the MASS package does just that:
> library(MASS) > fractions(.14) [1] 7/50
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With