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:
library(zipcodeR)
list1 <- c("45011","65322")
list2 <- c("65432","51545")for (i in zip1) {
for (j in zip2){
print(zip_distance(i,j))
}
}