I am trying to sample from an R data frame but I have some problems with the categorical variables. I am not taking a random subsamples of rows but I am generating rows such that the new variables have individually the same distribution of the original one. I am having problem with the categorical variables.I am trying to sample from an R data frame but