Return a compact list of indicator categories, codes and labels

category(q = NULL, as.list = FALSE)

Arguments

q

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

as.list

if TRUE returns a 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

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.list" : "true" \ -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"

See also

indicator to view complete indicator metadata records

Examples

# List all HarvestChoice indicators matching category 'demographics' category("demographics")
#> category subcategory item code #> 1: Demographics Health and Nutrition Anthropometrics weight #> 2: Demographics Health and Nutrition Anthropometrics weight_rur #> 3: Demographics Health and Nutrition Anthropometrics weight_urb #> 4: Demographics Health and Nutrition Anthropometrics mother_age #> 5: Demographics Health and Nutrition Anthropometrics mother_age_rur #> --- #> 134: Demographics Population Total PN12_TOT #> 135: Demographics Population Total PD12_TOT #> 136: Demographics Population Urban PN00_URB #> 137: Demographics Population Urban PN05_URB #> 138: Demographics Population Urban PD05_URB #> label #> 1: DHS sampling weight #> 2: DHS sampling weight (rural) #> 3: DHS sampling weight (urban) #> 4: Mother's age (years) #> 5: Mother's age (years) - rural #> --- #> 134: Total Pop. '12 #> 135: Total Pop. Dens. '12 #> 136: Urban Pop. '00 #> 137: Urban Pop. '05 #> 138: Urban Pop. density '05
# List all HarvestChoice indicators matching 'cassava' in a hierarchical list category("cassava", as.list=TRUE)
#> $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 #> #>