Hello I have never written in here because I always found an answer to my problems But now I have one and I can't find a way to resolve it. I have several lists with list in them. Every list is a part of a code and I'd like to paste all these lists in order to obtain all the possible combinations.
here is a list example
evaluation <- list()
for(i in 1:length(Dates)){
evaluation[[i]] <- list(snapshotDate = toString(Dates[i]))
}
Here is a picture of what is in the evaluation list
And here is the final content where i want to "paste" all the list. Where here I choose the 1st list for each.
content <- list(Eval = evaluation[1],
cont = cont[1],
con = con[1],
scenario = sce)
The goal at the end is to have a lot of this content(one for each combination of Eval, cont,con and sce) with in each of them one iteration.
I have 6 eval, 3 cont, 4 con and 1 sce (but they change over time so the code should be generic for this part) and I don't know how i could code this. I tried a loop but I'am unable to get all the combinations. Could someone help me.
Thanks for reading me and I hope I'll get some answers
Edit: Here is my code as asked by @Skaqqs
library(parsedate)# to have date in ISO8601
Days = 4
CL_list = c(0.99,0.95,0.90)
measuretype = c("relative")
TimeH = c(10,30,252)
PTF = c("1")
# Prepare Table of evaluations according to number of Days selected
Dates = lst(format_iso_8601(format(Sys.time())))
for (i in 0:Days){
tmp <- format_iso_8601(format(Sys.Date() - i))
Dates <- rbind(Dates, tmp)
}
# create Evaluation
evaluation <- list()
for( i in 1:length(Dates)){
evaluation[[i]] <- list(snapshotDate = toString(Dates[i]))
}
# create Cont
cont <- list()
for( i in 1:length(CL_list)){
cont[[i]] <- list(measureType = measuretype[1], confidenceLevel = CL_list[i])
}
# create con
con <- list()
for(i in 1:length(TimeH)){
con[[i]] <- list(type = 'connect', timeHorizon = TimeH[i])
}
# create sce
sce <- list(currency = 'USD', amountScheme = 'quantity', positions = "pos")
content <- list(Eval = evaluation[1],
cont = cont[1],
con = con[1],
scenario = sce)
Edit with the 2 screenshots for @Skaqqs How results should look like How it looks like