NASISChoiceList | R Documentation |
Create (ordered) factors and interchange between choice names, values and labels for lists of input vectors.
NASISChoiceList(
x = NULL,
colnames = names(x),
what = "ColumnPhysicalName",
choice = c("ChoiceName", "ChoiceValue", "ChoiceLabel"),
obsolete = FALSE,
factor = TRUE,
droplevels = FALSE,
ordered = TRUE,
simplify = TRUE,
dsn = NULL
)
x |
A named list of vectors to use as input for NASIS Choice List lookup |
colnames |
vector of values of the column specified by |
what |
passed to |
choice |
one of: |
obsolete |
Include "obsolete" choices? Default: |
factor |
Convert result to factor? Default: |
droplevels |
Drop unused factor levels? Default: |
ordered |
Should the result be an ordered factor? Default: |
simplify |
Should list result with length 1 be reduced to a single vector? Default: |
dsn |
Optional: path to local SQLite database containing NASIS table structure; default: NULL |
A list of "choices" based on the input x
that have been converted to a consistent target set of levels (specified by choice
) via NASIS 7 metadata.
When factor=TRUE
the result is a factor, possibly ordered when ordered=TRUE
and the target domain is a "ranked" domain (i.e. ChoiceSequence
has logical meaning).
When factor=FALSE
the result is a character or numeric vector. Numeric vectors are always returned when choice
is "ChoiceValue"
.
NASISChoiceList(1:3, "texcl")
NASISChoiceList(1:3, "pondfreqcl")
NASISChoiceList("Clay loam", "texcl", choice = "ChoiceValue")
NASISChoiceList("Silty clay loam", "texcl", choice = "ChoiceName")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.