event_search: Search for events

Description Usage Arguments Value Examples

View source: R/event-search.R

Description

Use the Yelp event search API to find events near a given location and in a given time range.

Usage

1
2
3
4
5
6
7
event_search(location = NULL, latitude = NULL, longitude = NULL,
  radius_m = 40000, datetime_start = Sys.time(),
  datetime_end = datetime_start + lubridate::ddays(7), is_free = NA,
  categories = NULL, locale = get_yelp_locale(), limit = 50L,
  offset = 0L, sort_on = c("popularity", "time_start"),
  sort_by = c("desc", "asc"),
  access_token = Sys.getenv("YELP_ACCESS_TOKEN", NA))

Arguments

location

A string describing the location.

latitude

A number representing the latitude to search close to.

longitude

A number representing the longitude to search close to.

radius_m

A number giving the radius, in metres, of the search circle around the specified location.

datetime_start

A date-time object coercible to POSIXct representing the earliest time for events.

datetime_end

A date-time object coercible to POSIXct representing the latest time for events.

is_free

Logical. Set to TRUE to return only cost-free events, FALSE to return only paid event, and NA for both.

categories

A character vector of search categories to filter on, or NULL to return everything. See SUPPORTED_CATEGORY_ALIASES for allowed values.

locale

A string naming the locale. See SUPPORTED_LOCALES for allowed values.

limit

An integer giving the maximum number of businesses to return. Maximum 50.

offset

An integer giving the number of businesses to skip before returning. Allows you to return more than 50 businesses (split between multiple searches).

sort_on

Should the return values be sorted by "popularity" or "datetime_start"?

sort_by

Either asc for ascending order, or desc for descending order.

access_token

A string giving an access token to authenticate the API call. See get_access_token.

Value

A data frame with 28 columns. Each row corresponds to one event.

Examples

1
2
3
## Marked as don't test because an access token is needed
events_in_houston <- event_search("houston")
if(interactive()) View(events_in_houston) else str(events_in_houston)

richierocks/yelp documentation built on Oct. 17, 2018, 2:21 a.m.