The digits after ^
( 1
, 2
and 3
) are the values that I want to automate (incrementally: from 1 to ith value):
var1<-rnorm(3,5000,1300)/1.15^1
var2<-rnorm(3,5000,1300)/1.15^2
var3<-rnorm(3,5000,1300)/1.15^3
But, automate within a for
loop:
for(i in 1:10){
name<-paste0('var',i)
assign(name,rnorm(3,5000,1300)/1.15^1)
}
How to insert this automation in the for
loop and avoid writing one function at a time?