Description Usage Arguments Value Examples
View source: R/rpubmed_locations.R
Returns a data frame of geocoded addresses with longitude and latitudes Uses the Google Maps geocode API
1 | geocode_addresses(addresses, sleeper = 0.33, depth = 3)
|
addresses |
A character vector of addresses for geocoding |
sleeper |
numeric Number of seconds between calls to the geocoding server |
depth |
integer recursion depth for attempting to get coordinates. If the full address fails to get a hit, the function is called again with the first line of the address removed. The process is repeated depth times before returning NAs |
data frame of addresses, latitudes and longitudes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
# get a list of articles pulled from pubmed:
abstracts <- fromJSON("Test/plasticity_abstracts.json")
# Extract affiliated addresses from article metadata:
affil_addresses <- get_article_location_data(abstracts)
# Get coordinates:
coords <- geocode_addresses(affil_addresses, depth = 4)
# plot coordinates on a map:
map("world", col="#f2f2f2", fill=TRUE, bg="white", lwd=0.05)
points(coords$long, coords$lat, col = "red", pch = 20)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.