Closed benjaminschlegel closed 6 years ago
Thanks for your contribution! I'll update the package soon. Would you like to be added as a contributor to the package?
If it's not much work for you to add me, that would be nice.
Can you send me your email? I can add that to the documentation.
kontakt@benjaminschlegl.ch
Thanks a lot for the great package, it's very usefull.
Is there a possibility you could add an option that removes the first dummy of every variable that only n-1 Dummies remain? It would be very helpfull for models which need numeric data, but only n-1 Dummies because of perfect multicolinearity.
The code for it:
add the code below:
for (col_name in char_cols) { unique_vals <- unique(dataset[, get(col_name)])
----- next lines new ---
if(remove.first.dummy){ unique_vals = unique_vals[-1] }
-------------------------
dataset[, (paste0(colname, "", unique_vals)) := 0] for (unique_values in unique_vals) { dataset[get(col_name) == unique_values, (paste0(colname, "", unique_values)) := 1] } }