nameData: Name SWS dataset

Description Usage Arguments Examples

Description

Adds human-readable names to keys automatically.

Usage

1
2
nameData(domain, dataset, dt, except, append = "_description",
  returnCodes = TRUE)

Arguments

domain

character. Domain of dataset

dataset

character. Name of dataset

dt

data.table or data.frame. The table to which you wish to add names. Its column names must correspond to the dimensions of the dataset specified. Use GetDatasetConfig to find the dimension names of a dataset

except

character. Vector of names in the table that you do not wish named. For example, "timePointYears"

append

character. Suffix to add to column name of names. If "" and returnCodes is FALSE, then adds no suffix to the final names

returnCodes

logical. If TRUE, descriptions are returned as columns after the codes. If FALSE, the codes are omitted from the output

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 
 ## Not run: 
 dat = structure(list(geographicAreaM49 = c("276", "36", "380", "4",
"716"), Value = c(0, 0.0555555555555556, 0, 0, 0.2)), row.names = c(NA,
 -5L), class = c("data.table", "data.frame"), .Names = c("geographicAreaM49",
 "Value"), sorted = "geographicAreaM49")
 
 nameData("agriculture", "aproduction", dat, except = "timePointYears")
 
## End(Not run)
 

SWS-Methodology/faoswsUtil documentation built on May 9, 2019, 11:53 a.m.