address_to_sf: Use tidygeocoder to convert an address or data frame with an...

View source: R/sf_to_df.R

address_to_sfR Documentation

Use tidygeocoder to convert an address or data frame with an address column to an sf object

Description

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 to FALSE.

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

Value

A sf object with POINT geometry for all geocoded addresses with valid coordinates.

See Also

geo, geocode


elipousson/overedge documentation built on Aug. 13, 2022, 7:41 p.m.