問題タブ [combn]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
93 参照

r - 大規模なデータセットで組み合わせを繰り返し実行する方法は?

背景- 一度に 10 行ずつ取得した 250 行のすべての可能な組み合わせのセットを徹底的に検索したいと考えています。これを繰り返し取得するために、次のコードを使用します

40 行を超えると、「サイズ n GB のベクトルを割り当てることができません」というエラーが表示されます。

理想的な解決策: a)ループ内で実行するたびに組み合わせをダンプでき、メモリを繰り返しフラッシュできる場合(ここでさらに条件を確認できます)b)組み合わせをcsvファイルにダンプできる場合メモリ豚。

ご協力ありがとうございました。

0 投票する
1 に答える
106 参照

r - Generate as many data frames as permutation of columns

I would like to generate as many data frames as the number of permutation of my columns, given that one column as to remain unpermutated (keep the same index position in all generated data frames). Here is the main dataframe:

Assume the 3rd colomn (Gamma) must keep its position, for a limited number of permutations, it is easy to use the column index and permute them manually like this:

and so on until all permutations of 3 out of 4 columns are reached:

It is inefficient and a nightmare with a large dataset. How to generate all data frames quickly without typing all permutations manually? I think permn or combn are usefull but I am unable to go any further.