Mimic tabulate command from Stata in R
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated 7 years ago . I'm trying to get a 2 way table in R similar to this one from Stata. I was trying to use CrossTable from gmodels package, but the table is not the same. Do you known how can this be done in R ? I hope at least to get the frequencies from when cursmoke1 == "Yes" & cursmoke2 == "No" and reversed In R I'm only getting totals from yes, no and NA. Here is the output: Stata .