datapackage: Write auxiliary files to CSV and JSON (Tabular Data Package...

Description Usage Arguments Details Value See Also Examples

Description

Auxiliary files and metadata are appended to all data packages, but may also be generated separately. Variable metadata is made available in tabular (.csv) and in JSON (.json) format in conformity with Tabular Data Package RFC specifications at http://dataprotocols.org/tabular-data-package/.

Usage

1

Arguments

var

character array of HarvestChoice indicator code(s)

format

file extension corresponding to the data package output format. See genFile. If NULL no auxiliary file is produced aside from metadata records in meta.csv.

dir

character, optional output directory. Default to current working directory.

Details

API call: Generate auxiliary files for soil organic carbon concentration and 2012 total population

$ curl http://hcapi.harvestchoice.org/ocpu/library/hcapi3/R/datapackage \ -d '{"var" : ["soc_d5", "PN12_TOT"]}' \ -X POST -H 'Content-Type:application/json'

Value

character array of generated auxiliary file names

See Also

indicator and category for other convenience methods to query HarvestChoice metadata.

Examples

1
2
3
4
# Generate auxiliary files for soil organic carbon concentration and 2012 total population
x <- datapackage(c("soc_d5", "PN12_TOT"))
x <- fread(x[1])
x

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