---
title: "`r params$title`"
author: "`r params$author`"
date: "`r format(Sys.time(), '%Y-%m-%d at %H:%M:%S %Z (UTC%z)')`"
output:
  pdf_document:
    toc: true
    toc_depth: 1
params:
  title: "Cognitive Interview: Heatmap and Coded Fragments"
  author: ""
  caption: "Heatmap"
---

```{r, eval=TRUE, echo=FALSE}

knitr::opts_chunk$set(echo = FALSE, comment="");

if (!exists('headingLevel') || !is.numeric(headingLevel) || (length(headingLevel) != 1)) {
  headingLevel <- 0;
}

```

The following codes were used for coding: `r rock::vecTxtQ(x$convenience$codingLeaves);`

# Heatmap

```{r, ci-heatmap, fig.width= (21 - 3) / 2.54, fig.height=(29.7 - 3 - 2) / 2.54, fig.cap=params$caption}

codingScheme <-
  rock::create_codingScheme(
        id = "codingScheme",
        label = "Coding Scheme",
        codes = x$convenience$codingLeaves # nrmSpec$nrm_spec$codes$code_id
      );

rock::ci_heatmap(
  x,
  codingScheme = codingScheme,
  theme = ggplot2::theme_minimal(base_size = 9)
) +
  ggplot2::theme(
    plot.title = ggplot2::element_text(hjust = 1),
    plot.subtitle = ggplot2::element_text(hjust = 1),
    axis.text.x = ggplot2::element_text(angle = 30,
                                        hjust = 0)
  );

```

# Data {.tabset .tabset-pills}

## Coded fragments

```{r show-information-hierarchically, results='asis'}

rock::resultsOverview_allCodedFragments(
  x,
  context=2
);

```
