get_crops: Get Crops

Description Usage Arguments Details Value References Examples

View source: R/agronomic-crops.R

Description

get_crops Calls Crops endpoint of API

Usage

1
2
3
4
5
6
7
get_crops(
  crop_id = "",
  keyToUse = awhereEnv75247$uid,
  secretToUse = awhereEnv75247$secret,
  tokenToUse = awhereEnv75247$token,
  apiAddressToUse = awhereEnv75247$apiAddress
)

Arguments

crop_id

Either a crop id to retrieve information for that specific crop or an empty string to retrieve information on all crops associated with the user's aWhere API account (string - optional)

keyToUse

aWhere API key to use. For advanced use only. Most users will not need to use this parameter (optional)

secretToUse

aWhere API secret to use. For advanced use only. Most users will not need to use this parameter (optional)

tokenToUse

aWhere API token to use. For advanced use only. Most users will not need to use this parameter (optional)

apiAddressToUse

Address of aWhere API to use. For advanced use only. Most users will not need to use this parameter (optional)

Details

Models are designed for specific crops, and often specific types or varieties of crops. This API provides the list of available crops. When creating a planting record, you're encouraged to specify the crop that is planted in the field using these records.

Within each category of crop (organized by name), there is a default crop. When creating a planting, you may not know or care about the specific variety, and can simply specify the crop name as what is planted there. When you do this, the system will use the default crop for that category. You'll know which crop record is the default by referencing the isDefaultForCrop property, described below.

Value

- data.frame containing information about requested crop(s)

References

https://developer.awhere.com/api/reference/crops

Examples

1
2
3
4
## Not run: get_crops('barley-generic')
         get_crops()

## End(Not run)

aWhereAPI/aWhere-R-Library documentation built on Nov. 5, 2021, 3:35 a.m.