I have used dummyVars
function from Caret
package before to make dummy variables out of characters/factors with also missing values (NA)
and it worked successfully.
This time, however, the output I get includes NA
values. The default is that it treats NA
also as a separate entry and makes a dummy variable for it as well. Am I missing something? More worried because it worked last time with NA
values.
Using the following code:
dum = dummyVars("~.",data = char_data_raw_train)
char_data_raw_train_dum = predict(dum, newdata = char_data_raw_train)
The output file, i.e. char_data_raw_train_dum
includes NA
s. Please help.