---
author: "`r paste0('Biodose Tools', ' v', utils::packageVersion(pkg = 'biodosetools'))`"
date: "`r format(Sys.time(), '%d %B, %Y %H:%M:%S')`"
output:
  pdf_document:
    number_sections: true
    extra_dependencies: ["graphicx", "newpxtext", "newpxmath"]
header-includes:
  - \usepackage{titling}
  - \usepackage{booktabs}
  - \usepackage{tabularx}
  - \usepackage{float}
  - \usepackage{colortbl}
  - \pretitle{
    \vspace{-50pt}
    \includegraphics[width=2.0625in,height=0.5in]{`r system.file("/app/reports/logo.pdf", package = "biodosetools")`}\LARGE\\
    \begin{center}}
  - \posttitle{\end{center}}

params:
  report_list: NA
---
---
title: "Interlab Report"
date: "`r Sys.Date()`"
output: html_document
---
```{r setup, include=FALSE}
library(dplyr)
library(knitr)
```

```{r render-table-fn, include=FALSE}
render_table <- function(x, font_size = NULL, ...) {
  knitr::kable(x, format = "latex", booktabs = TRUE, ...) %>%
    kableExtra::kable_styling(
      position = "center",
      latex_options = "HOLD_position",
      font_size = font_size
    )
}
```
# Summary Table

```{r curve-table, echo=FALSE}
summary_df <- params$report_list$curve_table
rownames(summary_df) <- NULL

data_1 <- summary_df[, c(1:8)] %>%
  as.matrix() %>%
  formatC(format = "f", digits = 3) %>%
  as.data.frame() 


data_2 <- summary_df[, c(9:15)] %>%
  as.matrix() %>%
  formatC(format = "f", digits = 3) %>%
  as.data.frame() 


data_1 %>%
  render_table(align = "c", escape = FALSE)

data_2 %>%
  render_table(align = "c", escape = FALSE)

```


```{r summary-table, echo=FALSE}
summary_df <- params$report_list$summary_table
rownames(summary_df) <- NULL

data_1 <- summary_df[, c(1:12)] %>%
  as.matrix() %>%
  formatC(format = "f", digits = 3) %>%
  as.data.frame() 


data_1 %>%
  render_table(align = "c", escape = FALSE)


```

`r if (!is.null(params$report_list$zscore_table)) {"# Z-Score Table"}`
```{r zscore-table, echo=FALSE}
if (!is.null(params$report_list$zscore_table)) {
params$report_list$zscore_table %>%
  as.matrix() %>%
  formatC(format = "f", digits = 3) %>%
  as.data.frame() %>%
  render_table(align = "c", escape = FALSE)
 }
```


# Comments

`r  params$report_list$comments`
