繁体   English   中英

R中所有可能的大数组合

[英]All possible combinations for large numbers in R

图片我有这样的序列:

seq <- rep(0:9, 10)

我想知道此序列的所有可能组合。 当然,命令combn不起作用:

> comb <- combn(seq, 10)
Error in matrix(r, nrow = len.r, ncol = count) : 
  invalid 'ncol' value (too large or NA)
In addition: Warning message:
In combn(seq, 10) : NAs introduced by coercion to integer range

您能给我一个提示,如何使我自己的功能适用于所有可能的组合吗?

根据您对评论的回复,这是您可以做的一件事。 您需要安装combinat软件包才能起作用。

library(combinat)
seq <- c(1,2,3,4,5,6,7,8,9,0)
permn(seq)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM