更新时间:2022-12-26 21:47:48
You can specify your store variable beforhand without determine how many values it shall store. If you want for each value a seperate variable take a look at the paste
function.
x<- NULL
for (i in 1:10){
x[i] <- i*2
}
*edit: The comment above is right. This way is not the most efficent one. But I still use it when computation time is not an issue.