I need help stepping through a second loop in R when a test fails in my first loop. Here's the logic:
- to start use config_list[1] from list
- then download file path_list[1] from list
- check if file passes test,
- if so, download path_list[1 + 1] file from list and go back to step 3
- if not, change config to next in list and go back to step 2 for failed file
Here's how far I've gotten:
path_list <- list("path1", "path2", "path3")
config_list <- list("a", "b", "c")
for (con in config_list) {
con[1] # set initial config
for (val in path_list) {
print(paste(val, "downloaded")) # download file
if (val == "path2"){ # check if file passes some test
con[1 + 1] # if above test fails change to con[1 + 1]
print(paste(val, "downloaded")) # download file again with new config ???
}
print(val)
}
}
config_list? At the moment, it is not included at all so folks trying to help are likely a bit confused about how to integrate it. Also, nothing here is an actual list, which is a specific data structure in R:path_listandconfig_listare both vectors. In your data, are they in vector or list format? This would have implications on how to approach this issue. Good luck!