From: yohannes alazar <hannesalazar_at_gmail.com>

Date: Thu 15 Jun 2006 - 01:35:21 EST

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 Received on Thu Jun 15 01:48:31 2006

Date: Thu 15 Jun 2006 - 01:35:21 EST

First I would really like to thank the mailing list for help I got in the
past, as a new to R I am really needing some support on hoe to code the
following problem.

I am trying to sort some data I have in a big file. The file has 4 columns and 19000 rows. An example of it looks like this:-

G 0.892 A 0.108

G 0.883 T 0.117

T 0.5 C 0.5

A 0.617 G 0.383

G 0.925 A 0.075

A 0.967 G 0.033

C 0.883 T 0.117

C 0.633 T 0.367

G 0.95 A 0.05

C 0.742 G 0.258

G 0.875 T 0.125

T 0.167 C 0.833

C 0.792 A 0.208

Columns one and three are alphabets while three and four are their corresponding values.

I wanted to sort this data so that my first and third columns are in alphabetic order. For example in the first row the order is "G" then "A". This is not in alphabetic order therefore we swap them along with their values and it becomes:

A 0.108 G 0.892

Row two looks fine but row three needs the same rearrangement as row one. And the final out put looks like:

A 0.108 G 0.892

G 0.883 T 0.117

C 0.5 T 0.5

A 0.617 G 0.383

A 0.075 G 0.925

A 0.967 G 0.033

C 0.883 T 0.117

C 0.633 T 0.367

A 0.05 G 0.95

C 0.742 G 0.258

G 0.875 T 0.125

C 0.833 T 0.167

A 0.208 C 0.792

Please some help with the relevant command names or a technique to code this task.

Thank you in advance

Regards Hannes

[[alternative HTML version deleted]]

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 Received on Thu Jun 15 01:48:31 2006

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.1.8, at Thu 15 Jun 2006 - 22:10:48 EST.

*
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help.
Please read the posting
guide before posting to the list.
*