quilt_form_data: Format text data to structure needed for 'quilt_write_form()'

Description Usage Arguments Value Examples

View source: R/quilt_form_data.R

Description

Format text data to structure needed for quilt_write_form()

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## 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)

quiltr documentation built on Dec. 2, 2021, 5:07 p.m.