[R] compute values by condition in DF by rownames

Karim Mezhoud kmezhoud at gmail.com
Mon Feb 16 16:09:38 CET 2015


Hi All,
how to compute only abs(value) > 0.2 of DF

               X2     gbm_tcga     lusc_tcga ucec_tcga_pub
   gbm_tcga  1.000000000  0.1405371906 -0.1028471639
   gbm_tcga  1.000000000  0.0441343447  0.0135680550
   gbm_tcga  1.000000000 -0.2000397119  0.0389718175
    gbm_tcga  1.000000000  0.1456991556  0.0099470445
    lusc_tcga  0.140537191  1.0000000000  0.1330807083
    lusc_tcga  0.044134345  1.0000000000  0.0620247126
    lusc_tcga -0.200039712  1.0000000000 -0.1302395515
     lusc_tcga  0.145699156  1.0000000000  0.0417966700
     ucec_tcga_pub -0.102847164  0.1330807083  1.0000000000
     ucec_tcga_pub  0.013568055  0.0620247126  1.0000000000
     ucec_tcga_pub  0.038971817 -0.1302395515  1.0000000000
     ucec_tcga_pub  0.009947045  0.0417966700  1.0000000000


and return

X2                     gbm_tcga     lusc_tcga ucec_tcga_pub

gbm_tcga               4                   1                  0
lusc_tcga                1                   4                  0
 ucec_tcga_pub       0                   0                   4

Thanks

 Karim

	[[alternative HTML version deleted]]



More information about the R-help mailing list