[英]R: Get all combinations of p binary variables
我想得到一个矩阵,其中包含 $p$ 二进制变量的所有 $2^p$ 组合。 感觉应该是单线的,但我似乎找不到。
好的,找到了:
p <- 3 l <- rep(list(0:1), p) expand.grid(l)
从这里: 生成向量元素所有可能组合的列表
[英]Binary Variables Combinations Analysis in R
[英]R get all common elements for all possible combinations of N variables
[英]In R, how can I get the sum for all combinations of two variables?
[英]Get frequency of different combinations in r with binary data
[英]Identify all combinations of six variables in R
[英]Create all possible combinations of binomic variables in r
[英]R - generate all possible pairwise combinations of binary vectors
[英]Get all possible combinations on a large dataset in R
[英]Combinations of Variables in R
[英]Identifying combinations of binary variables in tidyverse
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.