Hey team! I have been using the package zipcodeR to get a few mileage data points between zipcodes in USA using zip_distance and more recently wanted to pass each zipcode from list1 vs each zipcode in list2 to create a dataframe with all the outputs from the loop - i could get the loop to work, but have no idea how to have the sequential outputs on a df:
Instead of using loops, I would use expand.grid to make all the combinations and then the apply() function to iterate through the rows. In the example below, I used the paste() function because I don't have zipcodeR. I hope it gets the idea across.