autocomplete: Get autocompletion suggestions

Description Usage Arguments Value References Examples

View source: R/autocomplete.R

Description

Get term, business, and category autocompletion suggestions.

Usage

1
2
3
autocomplete(text, latitude = NULL, longitude = NULL,
  locale = get_yelp_locale(),
  access_token = Sys.getenv("YELP_ACCESS_TOKEN", NA))

Arguments

text

A string to find completions for.

latitude

A number representing the latitude to search close to. Required if you want business results, but can be NULL otherwise.

longitude

A number representing the longitude to search close to. Required if you want business results, but can be NULL otherwise.

locale

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

access_token

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

Value

A list of three elements.

terms

A character vector of completion of the text itself

businesses

A data frame of business name matches.

categories

A data frame of category matches.

References

https://www.yelp.com/developers/documentation/v3/autocomplete

Examples

1
2
3
4
## Marked as don't test because an access token is needed
(sleep_in_seattle <- autocomplete(
  "sleep", latitude = 47.6, longitude = -122.33
))

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