I am using R dummy.data.frame function in the dummies package to create dummy variables for the k levels of my factor. Unfortunately, my factor has NAs. When I use dummy.data.frame it creates k dummies with no NAs and a new dummy which flags with 1 the missing values. However, I would like to still have the NAs in the k dummies and not a dummy for the missing values.
Is this possible with that function? Do you know any other functions that can help me?