formbuildr

The package formbuildr was designed to readily create forms using the R console or a plain text file. A form is made of a series of questions and post-processing functions combined.

library(formbuildr)

Create a form with R console

Questions

q1 <- fob_int("How old are you?")
class(q1)
#> [1] "form_partial"

Various questions with answers of pre-determined types are already implemented.

R> q1()                                                            
❓ How old are you?
Enter your answer (an integer): 10                                 
✔ validated!
[1] 10

In interactive mode, validation are done interactively.

R> q1()                                                            
❓ How old are you?
Enter your answer (an integer): 10.1                               
⚠ Validation failed, try again!
Enter your answer (an integer): 10                                 
✔ validated!
[1] 10

Combining questions

Post-processing

Create a form from a plain text

Example