getAreaData: Function for obtaining the area harvested/sown data

Description Usage Arguments Value

View source: R/getAreaData.R

Description

This function pulls the trade data from the database. The main function pulling the data is faosws::GetData, but additional steps are performed by this function (such as setting up the appropriate pivot, adding variables which are missing from the data as NA's, and setting data with missing flags and 0 values to NA values).

Usage

1
2
getAreaData(dataContext, areaSownElementCode = "5025",
  areaHarvestedElementCode = "5312", seedElementCode = "5525")

Arguments

dataContext

The context for the data, as generated by the SWS. This object can be created via a call like swsContext.datasets[[1]] (assuming the user is running this script on the SWS or after a call to GetTestEnvironment).

areaSownElementCode

The element code providing the dimension which corresponds to the area sown variable in the database.

areaHarvestedElementCode

The element code providing the dimension which corresponds to the area harvested variable in the database.

seedElementCode

The element code providing the dimension which corresponds to the seed variable in the database.

Value

A data.table object containing the data queried from the database.


SWS-Methodology/faoswsSeed documentation built on Sept. 6, 2018, 5:06 a.m.