I need to multiply each column in a data.frame
by the values in first column (classfactor).
This is my data.frame
sample classfactor 01.BA.V 01.BA.VG 01.BO.VG 01.PR.O 01.TO.VG 02.BA.O 02.BA.V
AB 0.730 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0 0.00000000
AC 0.730 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0 0.00000000
AB 0.002 0.000000000 0.000000000 0.000749929 0.000000000 0.000000000 0 0.00000000
CC 0.730 0.081599145 0.093453018 0.031247022 0.015987076 0.036212483 0 0.02537884
BB 0.730 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0 0.00000000
AA 0.730 0.001533075 0.000108666 0.000000000 0.000364526 0.000241417 0 0.00006340
It has 146 rows and 155 columns.
I can't figure out how to do. Any suggestions?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…