0

我有以下数据框。

           Ensembl_ID    GeneNames      score
          ENSG00000011422     PLAUR   39.5685
          ENSG00000078328     A2BP1  50.00768
          ENSG00000081803    CADPS2  64.84489
          ENSG00000105976       MET  97.11081
          ENSG00000106366  SERPINE1  48.43963
          ENSG00000108576    SLC6A4 164.60561
          ENSG00000114062     UBE3A  59.33749
          ENSG00000115840  SLC25A12  77.22506
          ENSG00000146938    NLGN4X  57.59011
          ENSG00000151067   CACNA1C  54.06404
          ENSG00000152969   JAKMIP1  57.64859
          ENSG00000162946     DISC1  53.13775
          ENSG00000164418     GRIK2  22.93073
          ENSG00000166206    GABRB3  92.59465
          ENSG00000166501     PRKCB 105.63476
          ENSG00000172893     DHCR7  99.53791
          ENSG00000174469   CNTNAP2 174.89443
          ENSG00000180914      OXTR  90.86565
          ENSG00000189056      RELN  85.79417
          ENSG00000196338     NLGN3  37.61191
          ENSG00000251322    SHANK3 172.93547
          ENSG00000259207     ITGB3 144.50998

我只是使用以下对数据框进行排序

j_test <- j[order(round(as.numeric(j$Raw_score)),decreasing = TRUE, na.last = TRUE), ]

它执行以下操作。任何高于 100 的东西都会被忽略,并出现在下面的列表中。我希望它被正确排序。

       Ensembl_ID GeneNames      Score
      ENSG00000172893     DHCR7  99.53791
      ENSG00000105976       MET  97.11081
      ENSG00000166206    GABRB3  92.59465
      ENSG00000180914      OXTR  90.86565
      ENSG00000189056      RELN  85.79417
      ENSG00000115840  SLC25A12  77.22506
     ENSG00000081803    CADPS2  64.84489
     ENSG00000114062     UBE3A  59.33749
     ENSG00000152969   JAKMIP1  57.64859
     ENSG00000146938    NLGN4X  57.59011
     ENSG00000151067   CACNA1C  54.06404
     ENSG00000162946     DISC1  53.13775
     ENSG00000078328     A2BP1  50.00768
     ENSG00000106366  SERPINE1  48.43963
     ENSG00000011422     PLAUR   39.5685
     ENSG00000196338     NLGN3  37.61191
     ENSG00000164418     GRIK2  22.93073
     ENSG00000174469   CNTNAP2 174.89443
     ENSG00000251322    SHANK3 172.93547
     ENSG00000108576    SLC6A4 164.60561
     ENSG00000259207     ITGB3 144.50998
4

1 回答 1

1

您似乎在排序函数中给出了错误的列名。

j_test <- j[order(round(as.numeric(j$score)),decreasing = TRUE, na.last = TRUE), ]

样本输出:

        Ensembl_ID GeneNames     score
17 ENSG00000174469   CNTNAP2 174.89443
21 ENSG00000251322    SHANK3 172.93547
6  ENSG00000108576    SLC6A4 164.60561
22 ENSG00000259207     ITGB3 144.50998
15 ENSG00000166501     PRKCB 105.63476
16 ENSG00000172893     DHCR7  99.53791
4  ENSG00000105976       MET  97.11081
14 ENSG00000166206    GABRB3  92.59465
18 ENSG00000180914      OXTR  90.86565
19 ENSG00000189056      RELN  85.79417
8  ENSG00000115840  SLC25A12  77.22506
3  ENSG00000081803    CADPS2  64.84489
7  ENSG00000114062     UBE3A  59.33749
9  ENSG00000146938    NLGN4X  57.59011
11 ENSG00000152969   JAKMIP1  57.64859
10 ENSG00000151067   CACNA1C  54.06404
12 ENSG00000162946     DISC1  53.13775
2  ENSG00000078328     A2BP1  50.00768
5  ENSG00000106366  SERPINE1  48.43963
1  ENSG00000011422     PLAUR  39.56850
20 ENSG00000196338     NLGN3  37.61191
13 ENSG00000164418     GRIK2  22.93073

另外,我看不到 round() 函数是如何必要的。

于 2013-11-02T18:52:31.313 回答