I would like to know why I have a warning message.
My code was
univ_quali<-function(dataset){ print(cbind((addmargins(prop.table(dataset))), t(t(dataset))))}
> univ_quali(table(sex))
[,1] [,2]
1 0.5471698 58
2 0.4528302 48
It work but I have:
Warning message:
In cbind((addmargins(prop.table(dataset))), t(t(dataset))) :
number of rows of result is not a multiple of vector length (arg 1)