I'm using Google's API even though it's not free because it works better than OpenStreetMap when it comes to addresses and institution names.

geocode_address(df, address_col)

Arguments

df

A data frame that has a column for addresses.

address_col

Column for addresses. Tidyeval is used here so it doesn't need to be quoted.

Value

A data frame with all columns of df, but with city, state, and country added. Only rows with valid geocoding results are returned.