Description Usage Arguments Details Value Examples
Much of the AUPUS processing is done by computing functions of particular elements and using those calculated variables to update another element. Thus, it's often very important to have variables which specify which columns are needed. This specification can be very tedious, as often many elements are needed to compute a new element (as well as their flags/symbols and/or ratios).
1 | defineElementVariables(elements, aupusParam, envir = parent.frame(1))
|
elements |
A numeric vector containing the element numbers of interest. |
aupusParam |
A list of running parameters to be used in pulling the data. Typically, this is generated from getAupusParameter (see that function for a description of the required elements). |
envir |
An environment which specifies where the variables should be assigned. This defaults to parent.frame(1), which gives the calling environment, and thus should be sufficient for most (if not all) use cases. |
To avoid this complication, this function takes as an input the elements of interest and the aupusParam list (which defines how all the element value, flag, and ratio columns are named) and assigns the needed variables back to the calling environment (see example). For each element, three variables are created in the environment: elementXNum, elementXSymb, and ratioXNum (where X is the passed element number). These variables contain the column names of the nodes dataset that correspond with the value and symbol column for element X, respectively.
No value is explicitly returned. However, variables are assigned in the calling environment of this function.
1 2 3 4 5 6 7 8 9 10 | ## Not run:
exists("element51Num")
exists("element51Symb")
exists("ratio51Num")
defineElementVariables(51, faoswsAupus::aupusParam)
exists("element51Num")
exists("element51Symb")
exists("ratio51Num")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.