wg2ws_items: List of items to category table

View source: R/wg2ws_items.R

wg2ws_itemsR Documentation

List of items to category table

Description

Given a list of items, create a table of category scores

Usage

wg2ws_items(items, error_on_missing = TRUE, in_inside = "either")

Arguments

items

List of WG items present for individual.

error_on_missing

If TRUE, check whether all items are actual WG items. See helper function wg2ws_list_items().

in_inside

"In" and "inside" appear as two items on WG, but one ("inside/in") on WS. If "either," treat "inside/in" as endorsed if either appears. For "both", both must be endorsed. For "in" or "inside", treat "inside/in" as endorsed based solely on the presence of the indicated item.

Details

Requires a list that exactly matches items as labeled from Wordbank (check g_dict). Converts to a table of category scores, ready for use with wg2ws_category_score().

Value

A data frame with 22 rows indicating item totals for all WS categories. These values are not adjusted, and need to be adjusted with wg2ws_category_score().

Examples

# Create list of words a child knows
words <- c("smile", "old", "chicken (animal)", "breakfast", "snow", "uh oh",
           "please", "bad", "bicycle", "moon")
# Create table
categories <- wg2ws_items(words)

cdiWG2WS documentation built on June 17, 2025, 9:10 a.m.