安排包 - 顺序 128 的排列
我正在尝试使用 R 上的安排包在 128 个空格上运行“x”和“y”的简单排列。
我不断收到以下错误消息:
Error in permutations(test, k = 128, replace = TRUE) : too many results
我运行的代码如下:
library(arrangements)
test <- c('x','y')
permutations(test, k = 128, replace = TRUE)
sessionInfo() 如下:
R version 4.1.2 (2021-11-01)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.2.1
有我可以使用的解决方法吗?我也在尝试并行包。请指教。
I am trying to run a simple permutation of 'x' and 'y' across 128 spaces using the arrangements package on R.
I keep getting the following error message :
Error in permutations(test, k = 128, replace = TRUE) : too many results
The code that I ran was as follows:
library(arrangements)
test <- c('x','y')
permutations(test, k = 128, replace = TRUE)
sessionInfo() is as follows:
R version 4.1.2 (2021-11-01)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.2.1
Is there a work around I can use? I am also experimenting with the parallel package. Please advice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如 @Rui 在评论中指出的那样,结果太多了:
使用
skip
和nitem
参数怎么样?这允许用户一次检索少量结果。如果需要的话,这可以很容易地推广到并行处理。
That's way too many results as @Rui points out in the comments:
How about using the
skip
andnitem
parameters? This allows a user to retrieve a handful of results at a time.This can easily be generalized to parallel processing if needed.