Rapporter/rapport

throw error on missing required input

Closed this issue · 0 comments

This is a bug IMHO as if I do not specify a value for e.g. v in Example.tpl, no error msg is shown but we try to run the template (that would fail with a lame and irrelevant error msg of course):

rapport("Example", mtcars)
rapport.html("Example", mtcars)

Of course we should notify the user here that v is required. See:

> tpl.info('Example')

 "Example template"

 by Gergely Daróczi

 This template demonstrates the basic features of rapport. We all hope you will like it!

 packages:  lattice, ggplot2, xtable

 Examples: 
 rapport("Example", data = ius2008, v='age') 
 rapport("Example", data = ius2008, v='gender', pacman=FALSE) 
 rapport("Example", data = ius2008, v='age', s='FOO BAR') 

 Inputs

 "v" (Variable)  *required
 A variable
   - standalone:    no
   - length:        exactly 1 vector

 "pacman" (Pacman)
 Show Pacman in the results?
   - class:     logical
   - standalone:    yes
   - length:        exactly 1 value
   - value:     TRUE

 "s" (A string)
 Any character value to be printed at the end of the report
   - class:     character
   - standalone:    yes
   - length:        exactly 1 value
   - value:     "Bye!"
   - nchar:     exactly 1 character