geocode_st: Generate geocoded and time-stamped data

Description Usage Arguments Details Value Examples

View source: R/analysis_functions.R

Description

Use Google Maps API to produce longitude and latitude data

Usage

1
geocode_st(df, api_key)

Arguments

df

A data frame containing columns with the address (either "Address" or "address") and date (either "Date" or "date") of the cases.

api_key

A string. A valid Google Developers Geocode API key.

Details

A wrapper to functions from package googleway that checks for errors and fetches longitude and latitude coordinates using the Google Maps API. Dates are converted to integer values with t=1 being the earliest date provided.

Value

A data frame with the columns for longitude, latitude, and time.

Examples

1
2
3
4
5
6
7
## Not run: 
#requires working API to run
tmp <- data.frame(address=c("Buckingham palace","Big ben, Westminster","Marble arch, London"),
                  date = c("01/01/2020","02/01/2020","03/01/2020"))
geocode_st(tmp, api_key = "ENTER_KEY")

## End(Not run)

realTimeSurv documentation built on May 18, 2021, 9:07 a.m.