Geocode tbl geocodes a whole data frame

geocode_tbl(tbl, adresse, code_insee = NULL, code_postal = NULL)

Arguments

tbl

a data frame or tibble

adresse

adress column

code_insee

official citycode column

code_postal

official postcode column

Value

an augmented data frame of class tbl with latitude, longitude, etc

Examples


table_test <- tibble::tibble(
x = c("39 quai Andre Citroen", "64 Allee de Bercy", "20 avenue de Segur"),
y = c("75015", "75012", "75007"),
z = rnorm(3)
)

geocode_tbl(tbl = table_test, adresse = x)
#> Writing tempfile to.../tmp/RtmpA9JOPQ/file154373b254e6a.csv
#> If file is larger than 50 MB, it must be splitted
#> Size is : 61 bytes
#> SuccessOKSuccess: (200) OK
#> # A tibble: 3 × 19
#>   y           z x       latitude longitude result_label result_score result_type
#>   <chr>   <dbl> <chr>      <dbl>     <dbl> <chr>               <dbl> <chr>      
#> 1 75015 -0.874  39 qua…     48.8      2.28 39 Quai And…         0.98 housenumber
#> 2 75012 -1.23   64 All…     48.8      2.38 64 Allée de…         0.97 housenumber
#> 3 75007  0.0600 20 ave…     48.9      2.31 20 Avenue d…         0.97 housenumber
#> # … with 11 more variables: result_id <chr>, result_housenumber <chr>,
#> #   result_name <chr>, result_street <chr>, result_postcode <chr>,
#> #   result_city <chr>, result_context <chr>, result_citycode <chr>,
#> #   result_oldcitycode <chr>, result_oldcity <chr>, result_district <chr>
geocode_tbl(tbl = table_test, adresse = x, code_postal = y)
#> Writing tempfile to.../tmp/RtmpA9JOPQ/file154377fd37fc7.csv
#> If file is larger than 50 MB, it must be splitted
#> Size is : 81 bytes
#> SuccessOKSuccess: (200) OK
#> # A tibble: 3 × 19
#>         z x       y     latitude longitude result_label result_score result_type
#>     <dbl> <chr>   <chr>    <dbl>     <dbl> <chr>               <dbl> <chr>      
#> 1 -0.874  39 qua… 75015     48.8      2.28 39 Quai And…         0.98 housenumber
#> 2 -1.23   64 All… 75012     48.8      2.38 64 Allée de…         0.97 housenumber
#> 3  0.0600 20 ave… 75007     48.9      2.31 20 Avenue d…         0.97 housenumber
#> # … with 11 more variables: result_id <chr>, result_housenumber <chr>,
#> #   result_name <chr>, result_street <chr>, result_postcode <chr>,
#> #   result_city <chr>, result_context <chr>, result_citycode <chr>,
#> #   result_oldcitycode <chr>, result_oldcity <chr>, result_district <chr>