I have following code.
for(i in seq(from=1, to=8, by=1)) #i is number of stocks from a list
{
for(j in seq(from=1, to=8, by=1)) #j is number of trading days from another list
{
## Matching bid and ask prices of each stock for each date and update temp_table
select_output <- sqldf("select * from temp_table where FLAG == 'new' ")
}
}
In current scenario only the last iteration data is staying in select_output which is expected. I want to keep the file open to populate it with data from all the iterations. I don't want to use another loop for inserting data into select_output. Is there any other way possible in R? Please suggest if possible.
Thanks in advance.