library(MASS) ?fractions help.search("fractions") gets you there.
On Fri, 27 Jan 2006, Muhammad Subianto wrote: > Dear all, > Are there any functions to convert decimals to fractions in R? > I have the result: > > summary(as.factor(complete.ID)) > 0 0.0133333333333333 0.04 > 2256 488 230 > 0.0666666666666667 0.0933333333333333 0.106666666666667 > 2342 310 726 > 0.133333333333333 0.146666666666667 0.16 > 179 750 163 > 0.186666666666667 0.2 0.226666666666667 > 194 180 57 > 0.253333333333333 0.266666666666667 0.293333333333333 > 1 10 40 > 0.32 0.333333333333333 0.346666666666667 > 45 61 117 > 0.373333333333333 > 62 > > > > How to convert something like this: > > 0 1/75 3/75 > 2256 488 230 > 5/75 7/75 8/75 > 2342 310 726 > 10/75 11/75 12/75 > 179 750 163 > 14/75 15/75 17/75 > 194 180 57 > 19/75 20/75 22/75 > 1 10 40 > 24/75 25/75 26/75 > 45 61 117 > 28/75 > 62 > > Any suggestions would be appreciated. Thanks you. > Best, Muhammad Subianto > PS. > I found this website: http://www.mindspring.com/~alanh/fracs.html -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html