Retrieve a data frame of information about organizations that are listed on Petfinder.com. Filter searches based on location by specifying a postal code, city and state, country, or latitude and longitude.

pf_find_organizations(token = NULL, name = NULL, location = NULL,
  distance = NULL, state = NULL, country = NULL, sort = "recent",
  page = 1, limit = 20)

Arguments

token

An access token, provided by pf_accesstoken.

name

The name of organizations to be found (includes partial matches).

location

The location of organizations to be found. Values can be specified as "City, State", "latitude, longitude", or "zipcode".

distance

The distance, in miles, from the provided location to find organizations. Note that location is required to use distance.

state

The state from which to return organizations. Accepts two-letter abbreviations, e.g. AL, WY.

country

The country from which to return organizations. Accepts two-letter abbreviations, e.g. US, CA.

sort

The attribute on which to sort results. Possible attributes are "distance", "-distance", "name", "-name", "country", "-country", "state", or "-state".

page

The page(s) of results to return (default = 1).

limit

The maximum number of results to return per page (maximum = 100).

Value

A data frame of results matching the search parameters.

Examples

# NOT RUN {
US_orgs <- pf_find_organizations(token, country = "US", limit = 100, sort = "state")
MN_orgs <- pf_find_organizations(token, location = "Minneapolis, MN", distance = 50)
# }