sort_itemnames: Sorts item names according to user-specified priority

Description Usage Arguments Value Author(s) See Also Examples

View source: R/sort_itemnames.R

Description

This function sorts the item names according to instrument, domain, mode and number. The user can specify the sorting order.

Usage

1
2
3
sort_itemnames(x, order = "idnm")

order_itemnames(x, order = "idnm")

Arguments

x

A character vector containing item names (gsed lexicon)

order

A four-letter string specifying the sorting order. The four letters are: i for instrument, d for domain, m for mode and n for number. The default is "idnm".

Value

sort_itemnames() return a character vector with length(x) sorted elements. order_itemnames() return an integer vector of length length(x) with positions of the sorted elements.

Author(s)

Stef van Buuren

See Also

decompose_itemnames()

Examples

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

dscore documentation built on Nov. 29, 2020, 1:07 a.m.