View source: R/search_pop_times.R
search_pop_times | R Documentation |
Search an area for popular times.
search_pop_times(
sw,
ne,
radius = 180,
type = NULL,
key = Sys.getenv("GOOGLE_KEY"),
...
)
sw |
A numeric vector of length two with the format of c(lat, long) indicating the southwest point of a bounding box. Must be in decimal degrees and EPSG 4326. |
ne |
A numeric vector of length two with the format of c(lat, long) indicating northeast point of a bounding box. Must be in decimal degrees and EPSG 4326. |
radius |
The search radius of each grid element in meters. |
type |
A place type to limit the search to. See API docs for valid place types. Only one type may be specified per search. |
key |
Your Google Places API key. |
The Google Places API searches return a maximum of 60 responses regardless of a search's radius. To accommodate this limitation of the API, a search grid is created with a number of smaller circles with a defined radius via the radius
argument. Each cell in the grid uses a single API call. A smaller radius should be used to accommodate denser geographies.
The search grid used is saved the the attribute search_grid
and can be accessed attr(x, "search_grid")
.
sw <- c(42.988690, -71.465834)
ne <- c(42.995119, -71.455745)
manch_bars <- search_pop_times(sw, ne, radius = 200, type = "bar")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.