call_geonames: Get latitude and longitude from GeoNames

Description Usage Arguments Details Value See Also Examples

Description

call_geonames() is a wrapper to call the Geonames database and retrieve latitude and longitude for a given location

Usage

1
2
3
4
5
6
call_geonames(
  location,
  country = "",
  continent = "",
  bypass_first_attempts = FALSE
)

Arguments

location

A placename.

country

A country name, useful for those towns appearing in multiple countries, Default: ”

continent

A continent name, useful for the same reason as the country parameter, Default: ”

bypass_first_attempts

Logical. Whether to go straight to the fallback Default: FALSE

Details

continent parameter is ignored if a first attempt with it fails.

Value

A named list latitude, longitude), where each value is either a double or NA.

See Also

POST read_xml html_nodes,html_text

Examples

1
2
3
4
5
6
7
## Not run: 
if(interactive()){
 call_geonames('Paris', 'France')
 call_geonames('Istanbul', 'Turkey', 'Asia')# Still works despite geonames placing it in Europe
 }

## End(Not run)

E-dC/swing-events-explorer documentation built on July 17, 2020, 12:59 p.m.