R: Get all combinations of p binary variables

前端 未结 0 651
被撕碎了的回忆
被撕碎了的回忆 2021-02-09 19:28

I would like to get a matrix that contains all $2^p$ combinations of $p$ binary variables. It feels like something that should be a one-liner but I can\'t seem to find this.

相关标签:
回答
  • 消灭零回复
提交回复
热议问题