[R] merge two colums

Aimin Yan aiminy at iastate.edu
Tue Feb 27 12:31:13 CET 2007


I have a data set like this

 > head(data.1A24_aa_model)
     V1    V2 V3  V4 V5     V6
1 1A24 MODEL  1 ALA  1  84.47
2 1A24 MODEL  1 GLN  2  63.06
3 1A24 MODEL  1 TYR  3 107.72
4 1A24 MODEL  1 GLU  4  54.36
5 1A24 MODEL  1 ASP  5  67.01
6 1A24 MODEL  1 GLY  6 999.00

I want to change this to the following format:

    V1 V2 V3  V4 V5
1 1A24 MODEL  1 ALA _1  84.47
2 1A24 MODEL  1 GLN _2  63.06
3 1A24 MODEL  1 TYR _3 107.72
4 1A24 MODEL  1 GLU _4  54.36
5 1A24 MODEL  1 ASP _5  67.01
6 1A24 MODEL  1 GLY _6 999.00

anyone know how to do this?

Aimin



More information about the R-help mailing list