genRank: Rank agricultural productions across geographies

Description Usage Arguments Details Value See Also Examples

Description

Returns top and bottom commodities in terms of aggregate production, harvested area, and/or value of production.

Usage

1
genRank(var = "h", by = "ISO3", ...)

Arguments

var

one or several of "harvested area", "production", or "value of production". These argument can be abbreviated to "h", "p" or "v". May be expanded in the future to include additional sub-groups of indicators.

by

by default returns aggregate production across all selected countries. by may be specified to return aggregates across sub-zones (e.g. across provinces, districts, agro-ecological zones, etc.), see examples.

...

optional arguments passed to hcapi, e.g. iso3 and wkt

Details

API call: rank commodities in Angola and Mozambique by harvested area and production

$ curl http://hcapi.harvestchoice.org/ocpu/library/hcapi3/R/genRank/json \ -d '{"var" : ["h", "p"], "iso3" : ["AGO", "MOZ"]}' \ -X POST -H 'Content-Type:application/json'

API call: rank commodities across Angola's agro-ecological zones by production

$ curl http://hcapi.harvestchoice.org/ocpu/library/hcapi3/R/genRank/json \ -d '{"var" : "p", "iso3" : "AGO", "by" : "AEZ5_CLAS"}' \ -X POST -H 'Content-Type:application/json'

Value

data.table(s) of commodities ranked from top to bottom

See Also

hcapi

Examples

1
2
3
4
5
6
7
# Rank commodities in Angola and Mozambique by harvested area and production
x <- genRank(c("h", "p"), iso3=c("AGO", "MOZ"))
x

# Rank commodities across Angola's agro-ecological zones by production
x <- genRank("p", iso3="AGO", by="AEZ5_CLAS")
x

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