decompose_itemnames {dscore}R Documentation

Decomposes item names into their four components

Description

This utility function decomposes item names into components: instrument, domain, mode and number

Usage

decompose_itemnames(x)

Arguments

x

A character vector containing item names (gsed lexicon)

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 data.frame with length(x) rows and four columns, named: instrument, domain, mode, and number.

Author(s)

Stef van Buuren

References

https://docs.google.com/spreadsheets/d/1zLsSW9CzqshL8ubb7K5R9987jF4YGDVAW_NBw1hR2aQ/edit#gid=0

See Also

sort_itemnames()

Examples

itemnames <- c("aqigmc028", "grihsd219", "", "by1mdd157", "mdsgmd006")
decompose_itemnames(itemnames)

[Package dscore version 1.9.0 Index]