Error: 'expand_grid' is not an exported object from 'namespace:tidyr'

onlineloc=data.frame(lat=runif(5,29,34),
long=runif(5,69,72))
onlineloc=round(onlineloc,digits = 2)
instore=data.frame(lat=runif(5,29,34),
long=runif(5,69,72))
instore=round(instore,digits = 2)
#set.seed(100)
onlineloc
instore
#library(tidyr)
library(tidyverse)
library(dplyr)
all_combinations <- tidyr::expand_grid(instore,onlineloc)

results <- purrr::map2_dfr(x=all_combinations$instore,
                           y=all_combinations$onlineloc,
                           f = ~ tibble::enframe(gmapsdistance(origin = x, destination = y, mode = "driving", key = "") ))

dplyr::all_equal(instore$lat,onlineloc$lat,ignore_col_order = F,ignore_row_order = T)

What version of tidyr do you have? Try updating tidyr

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