Use tidygeocoder to convert an address or data frame with an address column to an sf object
Source:R/sf_to_df.R
address_to_sf.Rd
Wraps tidygeocoder::geo and tidygeocoder::geocode to convert a character string or a data frame with an address column.
Usage
address_to_sf(
x,
address = "address",
coords = c("lon", "lat"),
remove_coords = FALSE,
crs = NULL,
...
)
Arguments
- x
Data frame with an address column. Multiple address columns are not currently supported.
- address
Address column name, Default: 'address'
- coords
Coordinate columns for input dataframe or output sf object (if geometry is 'centroid' or 'point') Default: c("lon", "lat").
- remove_coords
For df_to_sf, if
TRUE
, remove the coordinate columns after converting a data frame to simple feature object; defaults toFALSE
.- crs
Cordinate reference system to return, Default: 4326 for sf_to_df and NULL for df_to_sf
- ...
Additional parameters passed to tidygeocoder::geo or tidygeocoder::geocode