hello i donot understand the problem when i generate random lat and long it didnot give distance and time (reprex below)and when i mention specific lat and long it gives both(reprex also attached) please help to solve the issue.
Lat= function(){
a = runif(1,29.000000,34.000000)
return(a)
}
Long= function(){
b = runif(1,69.000000,72.000000)
return(b)
}
onlineloc=data.frame(Lat=Lat(),Long=Long())
instore=data.frame(Lat=Lat(),Long=Long())
onlineloc
#> Lat Long
#> 1 32.5422 71.29198
instore
#> Lat Long
#> 1 32.53636 71.9005
library(gmapsdistance)
results = gmapsdistance(origin = "instore", destination = "onlineloc", mode = "driving", key = "")
results
#> $Time
#> [1] NA
#>
#> $Distance
#> [1] NA
#>
#> $Status
#> [1] "PLACE_NOT_FOUND"
refer to your answer how i can show same lat and long on google map with time and distance please guide and secondly i want to get distance only from results for further use in calculation how i can do it