get_itemnames {dscore} | R Documentation |
Extract item names
Description
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.
Usage
get_itemnames(
x,
instrument = NULL,
domain = NULL,
mode = NULL,
number = NULL,
strict = FALSE,
itemtable = NULL,
order = "idnm"
)
Arguments
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: |
Details
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.
Value
A vector with names of items
Author(s)
Stef van Buuren 2020
See Also
Examples
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")