Replacing the pattern in the code and generating many variants in r

49 views Asked by At

I have the following lines of code.

path="http:///XXXX"
a1=as.data.frame(csv[[1]][1][[1]]);a1$group="XXXX"

Also I have the names of the 1600 groups for example

df=c("ABC0","ABCF", .... "ZZZZ") 

(There is no pattern in the names of the groups)

I would like to generate the 1,600 sets of the codes in R using "df". For example,

path1="http:///ABC0"
a1=as.data.frame(csv[[1]][1][[1]]);a1$group="ABC0"

path2="http:///ABCF"
a2=as.data.frame(csv[[1]][1][[1]]);a2$group="ABCF"

path3="http:///ZZZZ"
a3=as.data.frame(csv[[1]][1][[1]]);a3$group="ZZZZ"
0

There are 0 answers