category: Return HarvestChoice indicator categories (3-level deep)

Description Usage Arguments Details Value See Also Examples

Description

Return a compact list of indicator categories, codes and labels

Usage

1
category(q = NULL, as.class = "data.table")

Arguments

q

character array of pattern(s) to search for. If omitted will return all available indicators.

as.class

"data.table" or "list" of indicator codes grouped by category

Details

# API call: list all HarvestChoice indicators matching category 'demographics' $ curl http://hcapi.harvestchoice.org/ocpu/library/hcapi3/R/category/json \ -d '{"q" : "demographics' \ -X POST -H "Content-Type:application/json"

# API call: list all HarvestChoice indicators matching 'cassava' in a hierarchical list $ curl http://hcapi.harvestchoice.org/ocpu/library/hcapi3/R/category/json \ -d '"q" :" cassava", "as.class" : "list" \ -X POST -H "Content-Type:application/json"

# To return a complete list of published indicators omit 'q' $ curl http://hcapi.harvestchoice.org/ocpu/library/hcapi3/R/category/json \ -X POST -H "Content-Type:application/json"

Value

a data.table showing the number of indicators in each category, or a list of indicators grouped by category

See Also

indicator to view complete indicator metadata records

Examples

1
2
3
4
5
# List all HarvestChoice indicators matching category 'demographics'
category("demographics")

# List all HarvestChoice indicators matching 'cassava' in a hierarchical list
category("cassava", as.class="list")

harvestchoice/hc-api3 documentation built on May 17, 2019, 3:04 p.m.