createFormApp: Creates a shinyform app from the defined questions and...

Description Usage Arguments Examples

View source: R/shinyform.R

Description

Creates a shinyform app from the defined questions and parameters set in formInfo.

Usage

1
createFormApp(formInfo)

Arguments

formInfo

A list with param: id, questions and storage

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
if (interactive()) {

library(shiny)
library(shinyforms)

questions <- list(
  list(id = "name", type = "text", title = "Name", mandatory = TRUE),
  list(id = "age", type = "numeric", title = "Age"),
  list(id = "favourite_pkg", type = "text", title = "Favourite R package"),
  list(id = "terms", type = "checkbox", title = "I agree to the terms")
)
formInfo <- list(
  id = "basicinfo",
  questions = questions,
  storage = list(
    # Right now, only flat file storage is supported
    type = STORAGE_TYPES$FLATFILE,
    # The path where responses are stored
    path = "responses"
  )
)

createFormApp(formInfo)
}

daattali/shinyforms documentation built on Jan. 25, 2021, 8:11 a.m.