I have a dataset that look something like this:
groupA <- rbinom(n=50,size=1,prob=0.5)
groupB <- rbinom(n=50,size=1,prob=0.5)
groupC <- rbinom(n=50,size=1,prob=0.5)
groupD <- rbinom(n=50,size=1,prob=0.5)
dtTest <- cbind(groupA, groupB, groupC, groupD)
where 0 means "no" and 1 means "yes".
Now, i want to create a table with a column Group
and another column answer
, stating yes or no.
How can this be done ?
I tried the melt
function and data.table
group by, but keep getting error.