I would like to create a k number of columns in R determined by an index k that is also part of the underlying function.
Data for replication:
D_s<-c(34,36,27,23,30,49,60)
S<-c("A","B","C","D","E","F","G")
data0<-data.frame(S, D_s)
This is the function of my mathematical model:

Instead of doing
data0<-data0 %>%
mutate(
Round1=((D_s*(1-1)/sum(D_s))),
Round2=((D_s*(2-1)/sum(D_s))),
Round3=((D_s*(3-1)/sum(D_s))),
Round4=...
)
I would guess there is a better way to do this, something in the form of (obviously not working, please don't judge):
for(k in 1:40){
data0<-data0 %>%
mutate(Round_i=((D_s*(i-1))/sum(D_s))
}
Thanks in advance!