Learn R Programming

PetfindeR (version 2.1.0)

breeds: Returns breed names of specified animal type, or types.

Description

Returns breed names of specified animal type, or types.

Usage

breeds(types, return_df = TRUE)

Arguments

types

Specifies the animal type or types. Can be a character vector representing a single animal type, or a vector or list of animal types if more than one type is desired.If not specified, all available breeds for each animal type is returned. The animal type must be of 'dog', 'cat', 'rabbit', 'small-furry', 'horse', 'bird', 'scales-fins-other', 'barnyard'.

return_df

If TRUE, the result set will be coerced into a pandas data.frame with two columns, breed and name.

Value

List of returned JSON data of available breeds for each specified animal type from the Petfinder API. If the parameter return_df is TRUE, a data.frame is returned instead.

Examples

Run this code
# NOT RUN {
pf <- Petfinder(key=key, secret=secret) # Initialize Petfinder class
cat_breeds <- pf$breeds('cat')
cat_dog_breeds <- pf$breeds(c('cat', 'dog'))
all_breeds <- pf$breeds()
all_breeds_df <- pf$breeds(return_df=TRUE)
# }

Run the code above in your browser using DataLab