quilt_form_data {quiltr}R Documentation

Format text data to structure needed for quilt_write_form()

Description

Format text data to structure needed for quilt_write_form()

Usage

quilt_form_data(
  prompt = NULL,
  text,
  response_type,
  options,
  addID = TRUE,
  nlow,
  nhigh,
  remove_NA = FALSE
)

Arguments

prompt

character string: prompt of text for labelling, e.g.: "Label this text: "; defaults to NULL

text

character vector: text inputs for labelling

response_type

character vector: one of c("yesno", "options", "scale", "text")

options

character vector of response options: e.g., c("big", "small", "biggie smalls")

addID

add an ID variable to the text data

nlow

integer: low end of numeric scale

nhigh

integer: high end of numeric scale

remove_NA

if TRUE: removes empty rows of text

Value

a data.frame

Examples

## Not run: 

data(lipsum_text)

qdat <- quilt_form_data(prompt = "Label this text: ",
                        text = lipsum_text$text, response_type = "yesno",
                        addID = T)

qdat <- quilt_form_data(prompt = "Label this text: ",
                        text = lipsum_text$text, response_type = "options",
                        options = c("Not at all", "Somewhat", "Very much"),
                        addID = T)

qdat <- quilt_form_data(prompt = "Label this text: ",
                        text = lipsum_text$text, response_type = "scale",
                        nlow = 1, nhigh = 10, addID = T)

## End(Not run)

[Package quiltr version 0.1.0 Index]