title: sort list according to length of list element R
body: <p>I am trying to sort my list element.But i get the following error.</p>
  
  <pre><code>Error in order(rmnull) : unimplemented type 'list' in 'orderVector1'
  </code></pre>
  
  <p>The code which cause the error is:</p>
  
  <pre><code>order(rmnull) 
  </code></pre>
  
  <p>where,<br>
      <code>rmnull</code> </p>
  
  <p>is my list. I have 100 lists, here i posted the one of them.</p>
  
  <pre><code>rmnull:
  [[1]]
  [[1]][[1]]
  [1] "VEGFA"  "EPHB2"  "GRIN2B" "AP2M1"  "KCNJ11" "ABCC8" 
  
  [[1]][[2]]
  [1] "VEGFA" "VTN"   "PRKCA" "ADCY5"
  
  [[1]][[3]]
  [1] "VEGFA" "KDR"   "GRB2"  "ADRB1"
  
  [[1]][[4]]
  [1] "VEGFA" "AKT1"  "AKT2" 
  
  [[1]][[5]]
  [1] "VEGFA" "CTGF"  "AP3D1" "AP3S2"
  
  [[1]][[6]]
  [1] "VEGFA" "YBX1"  "SMAD3" "ATF3" 
  
  [[1]][[7]]
  [1] "VEGFA"  "AKT1"   "IRS1"   "ATP2A2"
  </code></pre>
  
  <p>and my desired output is as follows:</p>
  
  <pre><code>[[1]][[4]]
  [1] "VEGFA" "AKT1"  "AKT2" 
  
  [[1]][[2]]
  [1] "VEGFA" "VTN"   "PRKCA" "ADCY5"
  
  [[1]][[3]]
  [1] "VEGFA" "KDR"   "GRB2"  "ADRB1"
  
  [[1]][[5]]
  [1] "VEGFA" "CTGF"  "AP3D1" "AP3S2"
  
  [[1]][[6]]
  [1] "VEGFA" "YBX1"  "SMAD3" "ATF3" 
  
  [[1]][[7]]
  [1] "VEGFA"  "AKT1"   "IRS1"   "ATP2A2"
  
  [[1]][[1]]
  [1] "VEGFA"  "EPHB2"  "GRIN2B" "AP2M1"  "KCNJ11" "ABCC8" 
  </code></pre>
  
  <p>The output of <code>dput</code> is as follows:</p>
  
  <pre><code>list(list(c("VEGFA", "EPHB2", "GRIN2B", "AP2M1", "KCNJ11", "ABCC8"
  ), c("VEGFA", "VTN", "PRKCA", "ADCY5"), c("VEGFA", "KDR", "GRB2", 
  "ADRB1"), c("VEGFA", "AKT1", "AKT2"), c("VEGFA", "CTGF", "AP3D1", 
  "AP3S2"), c("VEGFA", "YBX1", "SMAD3", "ATF3"), c("VEGFA", "AKT1", 
  "IRS1", "ATP2A2")), list(c("HHEX", "EFEMP2", "TP53", "ARIH2", 
  "ENSA", "ABCC8"), c("HHEX", "TLE1", "POLB", "PRKCA", "ADCY5"), 
  c("HHEX", "TLE1", "ATN1", "MAGI2", "ADRB1"), c("HHEX", "JUN", 
  "ESR1", "AKT2"), c("HHEX", "TLE1", "CDK1", "BUB1", "AP3B1", 
  "AP3S2"), c("HHEX", "JUN", "ATF3"), c("HHEX", "PML", "BCL2", 
  "ATP2A2")), list(c("PPP1R3A", "RPS6KA1", "MAPK1", "TP53", 
  "ARIH2", "ENSA", "ABCC8"), c("PPP1R3A", "PLN", "PRKACA", "ADCY5"
   ), c("PPP1R3A", "RPS6KA1", "GRB2", "ADRB1"), c("PPP1R3A", "RPS6KA1", 
  "PDPK1", "AKT2"), c("PPP1R3A", "RPS6KA1", "MAPK1", "IRS1", "AP3S1", 
  "AP3S2"), c("PPP1R3A", "RPS6KA1", "MAPK1", "SMAD3", "ATF3"), 
  c("PPP1R3A", "PLN", "ATP2A2")), list(c("TCF7L2", "EP300", 
  "TP53", "ARIH2", "ENSA", "ABCC8"), c("TCF7L2", "PSEN1", "PRKACA", 
  "ADCY5"), c("TCF7L2", "CTNNB1", "MAGI2", "ADRB1"), c("TCF7L2", 
  "EP300", "ESR1", "AKT2"), c("TCF7L2", "CSNK2A1", "ARR3", "AP3B1", 
  "AP3S2"), c("TCF7L2", "EP300", "SMAD3", "ATF3"), c("TCF7L2", 
  "CSNK2A1", "IRS1", "ATP2A2")), list(c("KCNQ1", "TRAF6", "SIGIRR", 
  "ENO2", "ENSA", "ABCC8"), c("KCNQ1", "KCNE4", "PRKCA", "ADCY5"
  ), c("KCNQ1", "AKAP9", "GRIN1", "DLG4", "ADRB1"), c("KCNQ1", 
  "TRAF6", "XIAP", "AKT2"), c("KCNQ1", "AKAP9", "GRIN1", "CLTC", 
  "AP3B1", "AP3S2"), c("KCNQ1", "AKAP9", "PPP1CA", "TP53", "ATF3"
  ), c("KCNQ1", "AKAP9", "PPP1CA", "BCL2", "ATP2A2")), list(c("LIPC", 
  "LRP1", "DLG4", "KCNJ2", "KCNJ8", "ABCC8"), c("LIPC", "LRP1", 
  "PRKACA", "ADCY5"), c("LIPC", "LRP1", "DLG4", "ADRB1"), c("LIPC", 
  "APOB", "HSP90AA1", "AKT2"), c("LIPC", "LRP1", "CTGF", "AP3D1", 
  "AP3S2"), c("LIPC", "LRP1", "PRKACA", "NFKB1", "ATF3"), c("LIPC", 
  "LRP1", "SHC1", "IRS2", "ATP2A2")), list(c("PRKCB", "DAB2", "AP2M1", 
  "KCNJ11", "ABCC8"), c("PRKCB", "RGS2", "ADCY5"), c("PRKCB", "PTPN11", 
  "GRB2", "ADRB1"), c("PRKCB", "GSK3B", "AKT2"), c("PRKCB", "OCLN", 
  "CSNK1A1", "AP3B1", "AP3S2"), c("PRKCB", "BTK", "TP53", "ATF3"
   ), c("PRKCB", "PTPN11", "IRS2", "ATP2A2")), list(c("OGG1", "PRKCA", 
  "DLG4", "KCNJ2", "KCNJ8", "ABCC8"), c("OGG1", "PRKCA", "ADCY5"
  ), c("OGG1", "PRKCA", "DLG4", "ADRB1"), c("OGG1", "PRKCA", "HSP90AA1", 
  "AKT2"), c("OGG1", "PRKCA", "PICK1", "ARF1", "AP3D1", "AP3S2"
  ), c("OGG1", "PRKCA", "TP53", "ATF3"), c("OGG1", "PRKCA", "BCL2", 
  "ATP2A2")))
  </code></pre>
  
  <p>Any help appreciated. Thanks.</p>