dictGenerator: Function to create sensata dictionary

View source: R/dictGenerator.R

dictGeneratorR Documentation

Function to create sensata dictionary

Description

This function allows you to create a dictionary from Sensata's data exported from Mongo.

Usage

dictGenerator(
  df,
  cols = c("qid", "identifier", "question", "type", "options", "numberOfOptions",
    "isOrdered", "isSorting", "maxResponses", "altOption"),
  expandOptions = TRUE,
  questionPrefix = "",
  forceOrdered = NULL,
  responseType = "newResponses"
)

Arguments

df

data downloaded from Mongo and loaded to R

cols

columns to create on the dictionary.

expandOptions

logical. If TRUE, the dictionary will have one row per answer option. if FALSE, it will be 1 row per question.

questionPrefix

character that identifies questions if not included in contentful. Default "".

forceOrdered

vector of ordered questions that are from a non-ordered types

responseType

which object version should the function use, one of "newResponses" or "structuredResponses"

Value

Dataframe dictionary useful for data cleaning

Author(s)

Camilo Delvasto camilo@sensata.io & Gabriel N. Camargo-Toledo gcamargo@sensata.io

Examples

dictGenerator(data = demoData, expandOptions = F)

SensataUX/sensataDataProg documentation built on April 18, 2023, 3:48 p.m.