長さが 50,000 を超えるスパース ベクトルを生成しています。forループで作成しています。ゼロを保存する効率的な方法があるのだろうか?
基本的にコードは次のようになります
score = c()
for (i in 1:length(someList)) {
score[i] = getScore(input[i], other_inputs)
if (score[i] == numeric(0))
score[i] = 0 ###I would want to do something about the zeros
}