For most of these functions you have to put results='asis' in the chunk header. Here is a summary of some of the qreport (plus a few from Hmisc) helper functions. The special formatting includes collapsible sections and marginal notes. Several of the functions construct Quarto callouts which are fenced-off sections of markup that trigger special formatting, especially when producing html. You can get help on these functions by the usual way of typing ?functionname at the console. Helper functions are defined when you activate the qreport package. 4.3 Quarto Report Writing Helper Functions For example, if a series of analyses were done in parallel using both parametric and nonparametric methods, one can use CSS so that when clicking a Nonparametric tab all the nonparametric analysis results will show throughout the document. Tricks can be used to flip all tabs with a single button. Tab sets and collapsible text are frequently helpful in report writing. aside information to the right of R output. See here for details about figure specifications inside code chunks. inline is more for printing character strings.Īn example of something that may not render correctly due to results='asis' being in the chunk header (needed for html(.)): If you specify inline=x the object x is printed with cat() instead of print(). If the argument obj to pr is a data frame or data table, variables will be rounded to the value given in the argument dec (default dec=3) before printing. pr is defined in the marksupSpecs$markdown$pr object, so you can bring it to your session by copying into a local function pr as shown below, which has a chunk option results='asis' to show that verbatim output appears anyway. If so, the object is surrounded by the markdown verbatim indicator-three consecutive back ticks. To do that a simple function pr can sense if results='asis' is in effect for the current chunk. To prevent this from happening you either need to split the chunks into multiple chunks (some with results='asis' and some not) or you need to make it clear that parts of the output are to be typeset verbatim. This process works smoothly but creates one complication: if you print an object that produces plain text in the same code chunk, the system will try to typeset it in html or \(\LaTeX\). To make use of specialized functions that produce html or \(\LaTeX\) markup, one often has to put results='asis' in the code chunk header to keep the system from disturbing the generated html or \(\LaTeX\) markup so that it will be typeset correctly in the final document. The following applies to earlier versions. With Hmisc package version 4.8 and later and rms package 6.5-0 and later, rendering in html no longer requires results='asis' in chunk headers, and a chunk can mix plain text and html without any problems.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |