getProductionData: Get Production Data

View source: R/getProductionData.R

getProductionDataR Documentation

Get Production Data

Description

This function returns the production data currently in the database for a particular DatasetKey. It also performs a few clean-up operations on the data before directly returning.

Usage

getProductionData(dataContext, areaVar = "geographicAreaM49",
  itemVar = "measuredItemCPC", elementVar = "measuredElement",
  yearVar = "timePointYears")

Arguments

dataContext

An object of type DatasetKey (defined in faosws). This parameter provides the configuration of the dataset (i.e. which countries, commodities, etc.).

areaVar

The column name of the country code column.

itemVar

The column name of the commodity code column.

elementVar

The column name of the element code column.

yearVar

The column name of the year column.

Value

A list of length 3:

  • query: A data.table containing the production data from the database.

  • formulaTuples: The element codes for the production, output, and yield elements. There may be multiple records in this table if multiple elements are relevant.

  • prefixTuples: This element contains the prefixes for the flags and values.


SWS-Methodology/faoswsProduction documentation built on March 21, 2023, 8:27 p.m.