Create dummy variables from bins.
rbin_create(data, predictor, bins)
data | A |
---|---|
predictor | Variable for which dummy variables must be created. |
bins | An object of class |
data
with dummy variables.
#> age job marital education default balance housing loan contact #> 1 34 technician married tertiary no 297 yes no cellular #> 2 49 services married secondary no 180 yes yes unknown #> 3 38 admin. single secondary no 262 no no cellular #> 4 47 services married secondary no 367 yes no cellular #> 5 51 self-employed single secondary no 1640 yes no unknown #> 6 40 unemployed married secondary no 3382 yes no unknown #> 7 58 retired married secondary no 1227 no no cellular #> 8 32 unemployed married primary no 309 yes no telephone #> 9 46 blue-collar married secondary no 922 yes no telephone #> 10 32 services married tertiary no 0 no no cellular #> 11 32 services married secondary no 414 yes no cellular #> 12 50 blue-collar married primary no 0 no no unknown #> 13 41 management married tertiary no 2226 no no cellular #> 14 38 services divorced primary no 0 yes no cellular #> 15 31 self-employed married tertiary yes 147 yes no cellular #> 16 42 admin. single secondary no 283 yes no unknown #> 17 56 retired married primary no -1 no no cellular #> 18 54 management divorced unknown no 901 no no unknown #> 19 42 management married secondary no 372 yes no telephone #> 20 58 services married secondary no 627 no no cellular #> 21 51 admin. married tertiary no 26 yes no telephone #> 22 44 management married secondary no 438 yes no telephone #> 23 51 management single unknown no -461 yes no unknown #> 24 41 management married tertiary no -195 no yes cellular #> 25 57 technician married secondary no 16063 yes no unknown #> 26 32 management single tertiary no 3097 yes no cellular #> 27 32 management married tertiary no 1232 no no cellular #> 28 45 management married tertiary no 4693 no yes cellular #> 29 56 entrepreneur married secondary no 196 no no cellular #> 30 38 technician married secondary no 0 yes no unknown #> 31 54 self-employed married tertiary no 990 no no cellular #> 32 53 unemployed single primary no 183 no no cellular #> 33 36 management single tertiary no 219 no no cellular #> 34 37 blue-collar married secondary no -97 yes no unknown #> 35 31 services single secondary no 222 yes no cellular #> 36 42 technician married secondary no 234 no no cellular #> 37 34 services single primary no 25 yes yes cellular #> 38 37 technician married secondary no 1762 no no cellular #> 39 59 blue-collar married primary no 80 yes no telephone #> 40 54 management married primary yes 0 yes yes cellular #> 41 54 blue-collar married primary no 1357 yes yes cellular #> 42 59 admin. married secondary no -198 yes yes cellular #> 43 33 management single tertiary no 2059 no no cellular #> 44 24 services single secondary no 258 yes no cellular #> 45 29 technician single tertiary no 2269 yes no cellular #> 46 49 blue-collar married secondary no 0 no no cellular #> 47 37 technician married secondary no 77 yes yes cellular #> day month duration campaign pdays previous poutcome y age_<_29 age_<_39 #> 1 29 jan 375 2 -1 0 unknown 0 0 1 #> 2 2 jun 392 3 -1 0 unknown 0 0 0 #> 3 3 feb 315 2 180 6 failure 1 0 1 #> 4 12 may 309 1 306 4 success 1 0 0 #> 5 15 may 67 4 -1 0 unknown 0 0 0 #> 6 14 may 125 1 -1 0 unknown 0 0 0 #> 7 14 aug 182 2 37 2 failure 0 0 0 #> 8 13 may 185 1 370 3 failure 0 0 1 #> 9 18 nov 296 2 -1 0 unknown 0 0 0 #> 10 21 nov 80 1 -1 0 unknown 0 0 1 #> 11 3 feb 236 2 272 1 failure 0 0 1 #> 12 9 jun 199 4 -1 0 unknown 0 0 0 #> 13 7 aug 182 2 99 1 failure 1 0 0 #> 14 20 nov 250 1 155 2 failure 0 0 1 #> 15 11 may 12 5 -1 0 unknown 0 0 1 #> 16 19 jun 446 1 -1 0 unknown 0 0 0 #> 17 27 aug 89 23 -1 0 unknown 0 0 0 #> 18 20 jun 7 3 -1 0 unknown 0 0 0 #> 19 31 jul 130 8 -1 0 unknown 0 0 0 #> 20 13 aug 110 4 -1 0 unknown 0 0 0 #> 21 28 aug 51 3 -1 0 unknown 0 0 0 #> 22 9 jul 42 1 -1 0 unknown 0 0 0 #> 23 28 may 33 2 -1 0 unknown 0 0 0 #> 24 20 nov 112 1 -1 0 unknown 0 0 0 #> 25 30 may 352 3 -1 0 unknown 0 0 0 #> 26 20 nov 167 1 -1 0 unknown 0 0 1 #> 27 25 aug 97 4 -1 0 unknown 0 0 1 #> 28 9 jul 148 2 -1 0 unknown 0 0 0 #> 29 19 nov 312 3 -1 0 unknown 0 0 0 #> 30 21 may 73 1 -1 0 unknown 0 0 1 #> 31 3 jun 244 2 -1 0 unknown 1 0 0 #> 32 9 jun 835 2 -1 0 unknown 0 0 0 #> 33 3 feb 22 6 196 6 failure 0 0 1 #> 34 5 jun 135 2 -1 0 unknown 0 0 1 #> 35 13 may 168 2 -1 0 unknown 0 0 1 #> 36 4 feb 765 2 -1 0 unknown 0 0 0 #> 37 9 apr 96 4 314 8 other 0 0 1 #> 38 16 apr 334 2 -1 0 unknown 1 0 1 #> 39 31 jul 46 21 -1 0 unknown 0 0 0 #> 40 6 may 95 1 -1 0 unknown 0 0 0 #> 41 5 may 305 5 349 7 other 0 0 0 #> 42 8 may 206 1 -1 0 unknown 0 0 0 #> 43 29 aug 106 2 -1 0 unknown 0 0 1 #> 44 18 may 248 1 -1 0 unknown 0 1 0 #> 45 20 apr 53 1 346 1 failure 0 0 1 #> 46 14 aug 189 4 -1 0 unknown 0 0 0 #> 47 21 nov 44 1 -1 0 unknown 0 0 1 #> age_<_56 age_>=_56 #> 1 0 0 #> 2 1 0 #> 3 0 0 #> 4 1 0 #> 5 1 0 #> 6 1 0 #> 7 0 1 #> 8 0 0 #> 9 1 0 #> 10 0 0 #> 11 0 0 #> 12 1 0 #> 13 1 0 #> 14 0 0 #> 15 0 0 #> 16 1 0 #> 17 0 1 #> 18 1 0 #> 19 1 0 #> 20 0 1 #> 21 1 0 #> 22 1 0 #> 23 1 0 #> 24 1 0 #> 25 0 1 #> 26 0 0 #> 27 0 0 #> 28 1 0 #> 29 0 1 #> 30 0 0 #> 31 1 0 #> 32 1 0 #> 33 0 0 #> 34 0 0 #> 35 0 0 #> 36 1 0 #> 37 0 0 #> 38 0 0 #> 39 0 1 #> 40 1 0 #> 41 1 0 #> 42 0 1 #> 43 0 0 #> 44 0 0 #> 45 0 0 #> 46 1 0 #> 47 0 0 #> [ reached 'max' / getOption("max.print") -- omitted 4474 rows ]