Dear JeeBee and all,
It is nice. Thanks you very much.
I must learn much more about ?as.fractions, ?as.numeric, ?as.character
and ?table functions.
Best wishes, Muhammad Subianto
On 7/28/06, JeeBee <[EMAIL PROTECTED]> wrote:
>
> Ah I see, I did not read your story well enough.
> You want to sort
Ah I see, I did not read your story well enough.
You want to sort after applying table()
Well, the idea I suggested was to keep the real numbers in,
because the fractions are sorted as characters strings (alphabetically),
which is not what you want. So, now I suggest the following:
# First apply
Dear all,
Thanks for your help.
I played with you suggest and still didn't sort (summary) which I need.
> t(table(at2[sort.order,c(1,3)]))
V1
jeebee -1 1
0 0 4
11/21 0 1
1/21 0
1/21 1 1
13/42 1 1
17/42 0 2
2/21 0 3
3/14 1 2
5/42 0 1
8/21 0 1
>
I n
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.
__
R-help@stat.math.ethz.ch mailing
Dear all,
Based on my question a few months ago
https://stat.ethz.ch/pipermail/r-help/2006-January/086952.html
and solved with
https://stat.ethz.ch/pipermail/r-help/2006-January/086955.html
https://stat.ethz.ch/pipermail/r-help/2006-January/086956.html
and from
https://stat.ethz.ch/pipermail/r-help