View source: R/get_itemnames.R
get_itemnames | R Documentation |
The get_itemnames()
function matches names against the 9-code
template. This is useful for quickly selecting names of items from a larger
set of names.
get_itemnames(
x,
instrument = NULL,
domain = NULL,
mode = NULL,
number = NULL,
strict = FALSE,
itemtable = NULL,
order = "idnm"
)
x |
A character vector, |
instrument |
A character vector with 3-position codes of instruments
that should match. The default |
domain |
A character vector with 2-position codes of domains
that should match. The default |
mode |
A character vector with 1-position codes of the mode
of administration. The default |
number |
A numeric or character vector with item numbers.
The default |
strict |
A logical specifying whether the resulting item
names must conform to one of the built-in names. The default is
|
itemtable |
A |
order |
A four-letter string specifying the sorting order.
The four letters are: |
The gsed-naming convention is as follows. Position 1-3 codes the instrument, position 4-5 codes the domain, position 6 codes direct/caregiver/message, positions 7-9 is a item sequence number.
A vector with names of items
Stef van Buuren 2020
sort_itemnames()
itemnames <- c("aqigmc028", "grihsd219", "", "age", "mdsgmd999")
# filter out impossible names
get_itemnames(itemnames)
get_itemnames(itemnames, strict = TRUE)
# only items from specific instruments
get_itemnames(itemnames, instrument = c("aqi", "mds"))
get_itemnames(itemnames, instrument = c("aqi", "mds"), strict = TRUE)
# get all items from the se domain of iyo instrument
get_itemnames(domain = "se", instrument = "iyo")
# get all item from the se domain with direct assessment mode
get_itemnames(domain = "se", mode = "d")
# get all item numbers 70 and 73 from gm domain
get_itemnames(number = c(70, 73), domain = "gm")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.