I have a character vector "x" that stores some values of the locations. When I run a while loop I get these locations
i <- 1
while (i < 5) {
print(x[c(i)])
i = i+1
}
Output is :
[1] "/SampleData/exp964/K8"
[1] "/SampleData/exp294/K9"
[1] "/SampleData/exp264/K3"
[1] "/SampleData/exp29/K1"
Now, what I want to do is to assign these outputs to an object something like this
s_1 = "/SampleData/exp964/K8"
s_2 = "/SampleData/exp294/K9"
s_3 = "/SampleData/exp264/K3"
s_4 = "/SampleData/exp29/K1"
so that I can point to any object or use it in my code just by using c(s(i)) or something like that.
Could someone please help me getting this wrkable.
Thank you