onlineloc=data.frame(lat=runif(orders,29,34),
long=runif(orders,69,72))
#> Error in runif(orders, 29, 34): object 'orders' not found
onlineloc=round(onlineloc,digits = 2)
#> Error in eval(expr, envir, enclos): object 'onlineloc' not found
instore=data.frame(lat=runif(orders,29,34),
long=runif(orders,69,72))
#> Error in runif(orders, 29, 34): object 'orders' not found
instore=round(instore,digits = 2)
#> Error in eval(expr, envir, enclos): object 'instore' not found
#set.seed(100)
library(tidyr)
all_combinations <- tidyr::expand_grid(instore,onlineloc)
#> Error: 'expand_grid' is not an exported object from 'namespace:tidyr'
results <- purrr::map2_dfr(.x=all_combinations$instore,
.y=all_combinations$onlineloc,
.f = ~ tibble::enframe(gmapsdistance(origin = .x, destination = .y, mode = "driving", key = "") ))
#> Error in map2(.x, .y, .f, ...): object 'all_combinations' not found
Created on 2020-02-08 by the reprex package (v0.3.0)