get_smarter_breeds: Get SMARTER Breeds

Description Usage Arguments Value Passing additional parameters Examples

View source: R/breeds.R

Description

Fetch SMARTER REST API breeds endpoint and returns results in a dataframe. Cached token is used or a new token is generated if not provided when calling this function (see get_smarter_token for more information)

Usage

1
get_smarter_breeds(query = list(), token = NULL)

Arguments

query

a list of query arguments

token

a string with a valid token

Value

Returns a dataframe with selected breeds

Passing additional parameters

Breeds endpoint supports additional parameters when making queries. Additional parameters need to be passed as list using the query parameter. For example, to get all the "Sheep" breeds you need to provide list(species="Sheep") as query parameter. Endpoint supports query by breed code and name. In addition, you can search using a pattern through the search parameter. See Swagger Breeds endpoint for more information about the breeds endpoint

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
selected_breed <- get_smarter_breeds(query = list(code = "TEX"))

selected_breeds <- get_smarter_breeds(query = list(search = "mer"))
## Not run: 

all_breeds <- get_smarter_breeds()

sheep_breeds <- get_smarter_breeds(query = list(species = "Sheep"))

## End(Not run)

cnr-ibba/r-smarter-api documentation built on Jan. 14, 2022, 9:42 p.m.