scaledic-package: Scale Dictionary

scaledic-packageR Documentation

Scale Dictionary

Description

A collection of procedures to bring labels, scales, missing values etc. to a data frame.

Author(s)

Juergen Wilbert [aut, cre]

Examples

# apply a dictionary file to a data frame
dat <- apply_dic(dat_itrf, dic_itrf)
# check for typos (not allowed values)
dat <- check_values(dat, replace = NA)
# Single imputation (EM algorith from the Amelia package)
# based on the variables of the provided scale
dat <- impute_missing(dat, scale == "ITRF" & subscale == "Ext")
dat <- impute_missing(dat, scale == "ITRF" & subscale == "Int")
# Show a table with all scales and scale labels included in the data frame
list_scales(dat, labels = TRUE)
# Example with pipeline syntax. Would be much easier to use the "describe" function
# from the psch packages instead of summarise_all here.
library(dplyr)
dat  |>
  select_items(scale == "ITRF" & subscale == "Ext")  |>
  rename_items(pattern = "{subscale_2}:{name}")  |>
  summarise_all(mean, na.rm = TRUE)  |>
  round(2)  |>
  t()

jazznbass/scaledic documentation built on July 19, 2023, 12:50 a.m.