get_smarter_samples: Get SMARTER Samples

View source: R/samples.R

get_smarter_samplesR Documentation

Get SMARTER Samples

Description

Fetch SMARTER REST API samples endpoint and returns results in a dataframe.

Usage

get_smarter_samples(species, query = list())

Arguments

species

a smarter species ("Goat", "Sheep")

query

a list of query arguments

Value

Returns a dataframe with selected samples

Passing additional parameters

Samples 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 "foreground" samples you need to provide list(type="foreground") as query parameter. Endpoint supports a lot of parameters and some of them can be provided multiple times See Swagger Samples endpoint for more information about the samples endpoint

Examples

italian_sheeps <- get_smarter_samples(
  "Sheep",
  query = list(country = "Italy")
)

merino_sheeps <- get_smarter_samples("Sheep", query = list(breed = "Merino"))

selected_goats <- get_smarter_samples(
  "Goat",
  query = list(country = "Italy", breed_code = "ORO", breed_code = "GAR")
)
## Not run: 

foreground_goats <- get_smarter_samples(
  "Goat",
  query = list(type = "foreground")
)

all_sheep_samples <- get_smarter_samples("Sheep")

## End(Not run)

cnr-ibba/r-smarter-api documentation built on July 2, 2024, 12:24 p.m.