google_timezone: Google timezone

Description Usage Arguments Value API use and limits Examples

View source: R/google_timezone.R

Description

The Google Maps Time Zone API provides time offset data for locations on the surface of the earth. You request the time zone information for a specific latitude/longitude pair and date.

Usage

1
2
3
4
5
6
7
8
google_timezone(
  location,
  timestamp = Sys.time(),
  language = NULL,
  simplify = TRUE,
  curl_proxy = NULL,
  key = get_api_key("timezone")
)

Arguments

location

vector of lat/lon pair

timestamp

POSIXct The Google Maps Time Zone API uses the timestamp to determine whether or not Daylight Savings should be applied. Will default to the current system time.

language

string specifies the language in which to return the results. See the list of supported languages: https://developers.google.com/maps/faq#using-google-maps-apis. If no langauge is supplied, the service will attempt to use the language of the domain from which the request was sent.

simplify

logical - TRUE indicates the returned JSON will be coerced into a list. FALSE indicates the returend JSON will be returned as a string

curl_proxy

a curl proxy object

key

string A valid Google Developers Timezone API key.

Value

Either list or JSON string of the timezone

API use and limits

The amount of queries you can make to Google's APIs is dependent on both the service and the API you are using.

Each API has specific quotas and limits. Check Google's API documentation for details.

View your usage at the Google Cloud Console https://console.cloud.google.com/

Each API can only accept and return one request at a time. If you write a loop to make multiple API calls you should ensure you don't go over your quota / limits during the loop.

Examples

1
2
3
4
5
6
## Not run: 
google_timezone(location = c(-37.81659, 144.9841),
               timestamp = as.POSIXct("2016-06-05"),
               key = "<your valid api key>")

## End(Not run)

googleway documentation built on Nov. 16, 2020, 9:08 a.m.