Guess which columns have lat and lon based on aliases like latitude, FacLat, etc.
Source:R/latlon_infer.R
latlon_infer.Rd
Guess which columns have lat and lon based on aliases like latitude, FacLat, etc.
See also
latlon_df_clean() latlon_is.valid() latlon_as.numeric()fixnames_aliases()
fixcolnames_infer()
Examples
latlon_infer(c('trilat', 'belong', 'belong')) # warns if no alias found,
# but doesnt warn of dupes in other terms, just preferred term.
latlon_infer(c('a', 'LONG', 'Longitude', 'lat')) # only the best alias is converted/used
latlon_infer(c('a', 'LONGITUDE', 'Long', 'Lat')) # only the best alias is converted/used
latlon_infer(c('a', 'longing', 'Lat', 'lat', 'LAT')) # case variants of preferred are
# left alone only if lowercase one is found
latlon_infer(c('LONG', 'long', 'lat')) # case variants of a single alias are
# converted to preferred word (if pref not found), creating dupes! warn!
latlon_infer(c('LONG', 'LONG')) # dupes of an alias are renamed and still are dupes! warn!
latlon_infer(c('lat', 'lat', 'Lon')) # dupes left as dupes but warn!