Bonjour,
Tu peux essayer la transposition:
Ton tableau (je l'apelle: "ma_table")
Station temp prof pH O2 Sal esp1 esp2 esp3 esp4
1 Station1 17 2.0 0.8 1.0 36.9 28 15 40 17
2 Station2 19 3.0 0.3 0.6 36.4 10 42 13 20
3 Station3 18 1.5 0.1 0.8 36.0 50 12 22 18
4 Station4 20 2.5 0.6 0.3 37.0 9 33 15 19
5 Station5 21 4.0 0.4 0.5 36.0 19 3 17 32
La transformation:
ma_transformation <- setNames(data.frame(t(ma_table[,-1])), ma_table[,1])
La tableau transformé:
Station1 Station2 Station3 Station4 Station5
temp 17.0 19.0 18.0 20.0 21.0
prof 2.0 3.0 1.5 2.5 4.0
pH 0.8 0.3 0.1 0.6 0.4
O2 1.0 0.6 0.8 0.3 0.5
Sal 36.9 36.4 36.0 37.0 36.0
esp1 28.0 10.0 50.0 9.0 19.0
esp2 15.0 42.0 12.0 33.0 3.0
esp3 40.0 13.0 22.0 15.0 17.0
esp4 17.0 20.0 18.0 19.0 32.0
Voilà. J'espère que cela te convient.
Partager