Return HarvestChoice indicator categories (3-level deep)

Usage

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

Value

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

Description

Return a compact list of indicator categories, codes and labels

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"

Examples

# List all HarvestChoice indicators matching category 'demographics' category("demographics")
category subcategory item code label 1: Demographics Health and Nutrition Anthropometrics weight DHS sampling weight 2: Demographics Health and Nutrition Anthropometrics weight_rur DHS sampling weight - rural 3: Demographics Health and Nutrition Anthropometrics weight_urb DHS sampling weight - urban 4: Demographics Health and Nutrition Anthropometrics mother_age Mother's age 5: Demographics Health and Nutrition Anthropometrics mother_age_rur Mother's age - rural --- 134: Demographics Population Total PN12_TOT Total Pop. '12 135: Demographics Population Total PD12_TOT Total Pop. Dens. '12 136: Demographics Population Urban PN00_URB Urban Pop. '00 137: Demographics Population Urban PN05_URB Urban Pop. '05 138: Demographics Population Urban PD05_URB Urban Pop. density '05
# List all HarvestChoice indicators matching 'cassava' in a hierarchical list category("cassava", as.class="list")
$Agriculture $Agriculture$`Harvested Area` category subcategory item code label 1: Agriculture Harvested Area Cassava cass_h Cassava area '05 2: Agriculture Harvested Area Cassava cass_i_h Irr. cassava area '05 3: Agriculture Harvested Area Cassava cass_r_h Rfd. cassava area '05 $Agriculture$Production category subcategory item code label 1: Agriculture Production Cassava cass_p Cassava prod. '05 2: Agriculture Production Cassava cass_i_p Irr. cassava prod. '05 3: Agriculture Production Cassava cass_r_p Rfd. cassava prod. '05 $Agriculture$`Value of Production` category subcategory item code label 1: Agriculture Value of Production Cassava cass_v Cassava val. prod. '05 2: Agriculture Value of Production Cassava cass_i_v Irr. cassava val. prod. '05 3: Agriculture Value of Production Cassava cass_r_v Rfd. cassava val. prod. '05 $Agriculture$Yield category subcategory item code label 1: Agriculture Yield Cassava cass_y Cassava yield '05 2: Agriculture Yield Cassava cass_i_y Irr. cassava yield '05 3: Agriculture Yield Cassava cass_r_y Rfd. cassava yield '05

See also

indicator to view complete indicator metadata records