This function takes a real value and converts it to 1 if it is positive and else to 0.
dicho(val)
val | A real value |
---|
0 or 1.
Frédéric Bertrand
frederic.bertrand@utt.fr
https://fbertran.github.io/homepage/
#> Y 1 Y 2 Y 3 Y 4 X1 X2 #> [1,] 5.3419555 4.180275 4.879056 4.7772359 4.577979 -0.7305749 #> [2,] 9.7633669 14.414315 4.988913 2.4139010 6.128001 4.7532461 #> [3,] -5.7833518 2.446599 3.873182 3.2301265 5.379399 1.5331008 #> [4,] -4.9963030 -3.402539 -7.490346 -3.3716915 -5.735446 -0.4505463 #> [5,] -7.7250172 -18.180852 2.800905 0.9371337 -1.491120 -6.7152298 #> [6,] -8.9903305 -9.478774 -9.498890 -2.1783763 -7.932759 -4.2194323 #> [7,] -0.3724814 -5.666992 6.001864 -9.8526091 -1.117630 4.6739968 #> [8,] 2.9824349 -8.428449 14.219899 -21.5612906 -1.505533 11.4655131 #> [9,] -3.7388123 6.349168 -17.060522 -11.5718352 -12.557058 5.5129233 #> [10,] -1.1463014 -19.327701 -2.319765 -7.2042570 -9.093328 -5.1550080 #> X3 X4 X5 X6 #> [1,] 1.8026469 6.5879934 1.26130300 3.796816 #> [2,] 7.4792162 8.2983052 6.92598750 9.662158 #> [3,] 2.8578107 -0.2653401 -4.09774978 -2.759580 #> [4,] -0.7818604 -7.3326774 -2.04557329 -2.360285 #> [5,] -11.3704455 -2.2650184 -7.47481290 -12.143825 #> [6,] -3.5907371 -10.3785938 -6.65893071 -6.033806 #> [7,] -7.0513093 -0.6036242 5.18569796 -6.549327 #> [8,] -13.6876277 1.1452475 14.12845203 -11.036526 #> [9,] 5.8019789 -14.7394994 3.32891140 3.644716 #> [10,] -14.1146075 -3.8813864 0.05939959 -8.891192dicho(dataAstar4)#> Y 1 Y 2 Y 3 Y 4 X1 X2 X3 X4 X5 X6 #> [1,] 1 1 1 1 1 0 1 1 1 1 #> [2,] 1 1 1 1 1 1 1 1 1 1 #> [3,] 0 1 1 1 1 1 1 0 0 0 #> [4,] 0 0 0 0 0 0 0 0 0 0 #> [5,] 0 0 1 1 0 0 0 0 0 0 #> [6,] 0 0 0 0 0 0 0 0 0 0 #> [7,] 0 0 1 0 0 1 0 0 1 0 #> [8,] 1 0 1 0 0 1 0 1 1 0 #> [9,] 0 1 0 0 0 1 1 0 1 1 #> [10,] 0 0 0 0 0 0 0 0 1 0