## Measure the distance between cities
lookup_table <- data.frame(x = c("Melbourne", "Melbourne", "Sydney"),
y = c("Sydney", "Brisbane", "Brisbane"),
dist = c(713.4, 1374.8, 732.5))
comparator <- Lookup(lookup_table, c("x", "y"), "dist")
comparator("Sydney", "Melbourne")
comparator("Melbourne", "Perth")
Run the code above in your browser using DataLab