Use this function to export a templated report for cognitive interviews. To embed it in an R Markdown file, use !!! CREATE rock::knit_codebook() !!!

template_ci_heatmap_1_to_pdf(
  x,
  file,
  title = "Cognitive Interview: Heatmap and Coded Fragments",
  author = NULL,
  caption = "Heatmap",
  headingLevel = 1,
  silent = rock::opts$get("silent")
)

Arguments

x

The codebook object (as produced by a call to parse_sources()).

file

The filename to save the codebook to.

title

The title to use.

author

The author to specify in the PDF.

caption

The caption for the heatmap.

headingLevel

The level of the top-most headings.

silent

Whether to be silent or chatty.

Value

x, invisibly

Examples

# \donttest{
### Use a temporary file to write to
tmpFile <- tempfile(fileext = ".pdf");

### Load an example CI
examplePath <- file.path(system.file(package="rock"), 'extdata');
parsedCI <- parse_source(file.path(examplePath,
                                   "ci_example_1.rock"));

rock::template_ci_heatmap_1_to_pdf(
  parsedCI,
  file = tmpFile
);
#> ! Font T1/cmr/m/n/10=ecrm1000 at 10.0pt not loadable: Metric (TFM) file not fou
#> nd.
#> <to be read again> 
#>                    relax 
#> l.105 \fontencoding\encodingdefault\selectfont
#> 
#> ! kpathsea: Running mktextfm ecrm1000
#> 
#> ! /usr/share/texlive/texmf-dist/web2c/mktexnam: Could not map source abbreviation  for ecrm1000.
#> 
#> ! /usr/share/texlive/texmf-dist/web2c/mktexnam: Need to update ?
#> 
#> ! mktextfm: Running mf \mode:=ljfour; mag:=1; nonstopmode; input ecrm1000
#> 
#> ! /usr/bin/mktextfm: line 106: mf: command not found
#> 
#> ! grep: ecrm1000.log: No such file or directory
#> 
#> ! mktextfm: `mf \mode:=ljfour; mag:=1; nonstopmode; input ecrm1000' failed to make ecrm1000.tfm.
#> 
#> ! kpathsea: Appending font creation commands to missfont.log.
#> Error: LaTeX failed to compile /tmp/Rtmp2hCmK5/file39254a5ff893ed.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See file39254a5ff893ed.log for more info.
# }