When moving data from GAMS to R via SQLite we have three possible spots where we can apply some data manipulation:
Suppose we want to plot some data but need to do:
Here is the code in GAMS:
I could do the same thing in R, but the code is slightly more messy:
The final attempt is in SQL, which is not too bad either (but with nested queries more complicated than the GAMS version):
In all cases we did not use any loops.