error: 'expand_grid' is not an exported object from 'namespace:tidyr' & Error in map2(.x, .y, .f, ...) : object 'all_combinations' not found

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)

Can you please clearly explain what your issue is and provide a proper reprex, you are not defining orders object in your code, thus you get those error messages when using the reprex package

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.