Hi,
I want to create a for loop that does 2 things:
1. creates new columns based on the indices of the for loop (this works as it creates min_val0 and min_val1 columns)
2. make a formula (minimum function) for each newly created column that will take present columns based on indices of the for loop (does not work)
It seems that trying to concatenate "val0_ " and char(i) inside the formula and minimum function is breaking. Is there any other work around for this? This is a small example but in my case I have hundreds of columns that would need to this type of code.
Code:
for(i = 0, i <= 1, i += 1,
new column("min_val" || char(i), formula(minimum(("val0_" || char(i)), :Name("val1_0"),:Name("val2_0"))))
)
