I have a base query that i am trying to add 14 other strings to, which are named query1:14
I am trying to combine them using paste and the following works for one query. However, i am trying to set this up in a function which will have the number of queries passed to it, to know how many it should loop/add into the final restuls
Here is some code to add one query, which works:
result<- paste(base_query, eval(as.name(paste0("query", 2)))
Here is something i tried to loop the queries added, to no success
range <- 14
result<- paste(base_query, while(loop<range){loop<-loop+1
eval(as.name(paste0("query", loop)))}
I'm not sure how to get the names generated in the while loop to be added to the paste, thanks