pf_find_organizations: Search for organizations

Description Usage Arguments Value Examples

View source: R/pf_find_organizations.R

Description

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.

Usage

1
2
3
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

1
2
3
4
5
## 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)

## End(Not run)

earl88/PetFindr documentation built on Jan. 18, 2020, 9:10 a.m.