[R] convert decimals to fractions - sorted

JeeBee JeeBee at troefpunt.nl
Wed Jul 26 11:43:23 CEST 2006


Hi Muhammad,

How about this?

at <- read.table(textConnection(a))
at2 <- cbind(at, jeebee=as.character(as.fractions(as.numeric(at[,2]))))

sort.order <- order(at2$V2)

at2[sort.order,]
at2[sort.order,c(1,3)]

JeeBee.



More information about the R-help mailing list