Learn R Programming

realTimeSurv (version 1.0)

geocode_st: Generate geocoded and time-stamped data

Description

Use Google Maps API to produce longitude and latitude data

Usage

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.

Value

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

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.

Examples

Run this code
# 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")
# }

Run the code above in your browser using DataLab