I need some advice about which package command I can use in R to get from df to df2:
data frame called df where: ex this is the head of df:
GeneIndex SampleIndex tpm GeneID GeneName
<int> <int> <dbl> <chr> <chr>
1 0 3893 3.231526e-01 ENSG00000223972.5 DDX11L1
2 0 14906 0.000000e+00 ENSG00000223972.5 DDX11L1
3 0 7474 0.000000e+00 ENSG00000223972.5 DDX11L1
4 0 1220 3.824092e-29 ENSG00000223972.5 DDX11L1
5 0 15831 0.000000e+00 ENSG00000223972.5 DDX11L1
6 0 5471 1.445461e-01 ENSG00000223972.5 DDX11L1
. ... ... .. .. ..
To this where it looks more like a gene matrix as an example: Where the SampleIndex is now transposed, the tpm values are maintained for each sample index and geneid; and the rows are GeneID df2
GeneID 3893 14906 7474 1220 15831 5471
ENSG00000223972.5 3.231526e-01 0.000000e+00 0.000000e+00 3.824092e-29 0.000000e+00 1.445461e-01
尚未成功......