
Automatic scale scoring from a dic file
score_from_dic.RdThis function is deprecated. Please score scales directly from within R. Use
the get_scales() and score_scale() functions. This function takes a
data frame and a dic file with scale definitions and applies the specified
scoring functions to create new variables for each scale. The scoring
functions can be specified in the dic file, and if not provided, it defaults
to using the mean of the items in the scale. The new variables will be named
according to the 'item_name' column in the dic file. The function first
checks for the presence of dic information either in the data frame's
attributes or as a separate argument. It then iterates through each scale
defined in the dic file, applies the specified scoring function to the
relevant items, and creates new variables for each scale. Finally, it returns
a data frame with the new scale scores.