我有这个:
# A simple "script" that receives an index
ScriptR = function(i) {
A = i^3;
};
# With "for", pass the index "i" for "ScriptR"
for (i in 1:10) {
ScriptR(i);
};
# How do I pass the index "i" for "ScriptR" function ??
mclapply(1:10, ScriptR, mc.set.seed = FALSE);
如何为“ScriptR”函数传递索引“i”?
Tks