A set of event-handler functions to be called when certain actions are performed on a
ReportingTools ships with a number of predefined ReportHandlers constructorslo functions which generate ReportHandlers objects which implement commonly desired behaviors:
Accepts destination file location in the form of a character value, which is stored in the object's location slot. Report is built up internally and written to a file via the
As with fileHandlers except that a table of contents is appended to the be beginning of the report with links to each element within the page. Link text is the element names
Accepts a connection to which the report should be streamed (which is stored in the location slot). Report is streamed out to the provided connection as elements are added to the report. codefinish completes the page and closes the connection.
Accepts an option filename argument which will be stored as the location slot, but is not used internally. Elements are streamed in HTML form to standard output, which is captured by knitr and inserted into the page, allowing ReportingTools to be used as a formatting mechanism to publish objects within a knitr document and have them displayed correctly. Note: location MUST match the output file actually generated by the knitr/knit2html call (at least up to destination directory). If it does not the resulting page will not function properly.
These handlers allow ReportingTools to be used as a formatting mechanism within a shiny Web application. Note in this case there is no meaninggful HTML file being created that represents the report. location is set to
NULLas no meaningful location exists in the shiny case.
Objects from the Class
Objects can be created by calls of the form
A function to be called when the report is initialized/created
A function to be called when an element is added/published to the report
A function to be called when an element is removed from the report
A function to be called when the report is "finished"
A named list containing zero or more of the elements "init", "addElement", "removeElement", and "finish", which contain additional arguments to be passed to the respective functions when called.
An R object indicating the location these handlers will publish the report to. The exact meaning of this argument depends on the behavior of the handlers.
signature(object = "ReportHandlers"): For file handlers, the file system location where the file will be written. For all others, NULL.
Returns the location associated with these ReportHandlers
Gabriel Becker <firstname.lastname@example.org>
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.