dot-prep_vas function

Data checking/preparation: VAS variable

Data checking/preparation: VAS variable

The function prepares the data for VAS (Visual Analogue Scale) analyses.

.prep_vas(df, name)

Arguments

  • df: A data frame.
  • name: Column name in the data frame that holds the VAS score. The column can only contain integers or NAs

Returns

A modified data frame with the VAS score renamed to "vas". If any checks fail (e.g. column is not numeric), an error message is displayed and the function is stopping.

Examples

df <- data.frame(vas_score = c(20, 50, 80, NA, 100)) .prep_vas(df = df, name = "vas_score") df <- data.frame(vas_score = c(20.5, 50, 80, NA, 100)) .prep_vas(df = df, name = "vas_score")
  • Maintainer: Kim Rand
  • License: GPL (>= 2)
  • Last published: 2024-05-21

Useful links