"

  knitr::opts_chunk$set(echo = FALSE)
  testing <- length(params$General)==1L && (is.na(params$General) | params$General=="NA")
  if (testing) {
    report_file <- "report_vorlage_analyt.Rmd"
    logo_file <- "BAMLogo2015.png"
    fnc_get_local_file <- function(x=NULL) {
      pkg_path <- system.file(package = "eCerto")
      file_path <- list.files(path=pkg_path, pattern = x, recursive = TRUE)[1]
      return(file.path(pkg_path, file_path, fsep="/"))
    }
    res <- eCerto::CRM001
    G <- res$General
    C <- res$Certification
    CP <- res$Certification_processing
    A <- ifelse(!is.null(res$selected_tab), res$selected_tab, names(G$apm)[1])
    D <- G$apm[[A]]
    if (!file.exists(file.path(dirname(fnc_get_local_file(x=report_file)), logo_file))) {
      warning(paste(logo_file, "is not in same folder as", report_file))
    }
    L <- logo_file
  } else {
    G <- params$General
    C <- params$Certification
    CP <- params$Certification_processing
    A <- ifelse(params$selected_tab %in% names(G$apm), params$selected_tab, names(G$apm)[1])
    D <- G$apm[[A]]
    L <- params[["logo_file"]]
  }

Note! This is a Report template for demonstration purpose. Specific layouts can be generated on demand.


  knitr::include_graphics(L)

eCerto Analyte Report

Meta Data

| | | | | |--------------:|:---------------|-------------:|:------------------------------------| | Study ID: | r G$study_id | Date: | r format(Sys.time(), '%d %B, %Y') | | User: | r G$user | Analyte: | r A |

Data Import

These files have been provided to the tool by r G$user:

if (length(C$input_files)>1) {
  cat(paste(C$input_files, collapse=",\n"))
} else {
  if ("File" %in% colnames(C$data)) cat(paste(unique(as.character(C$data[,"File"])), collapse=",\n"))
}

This is the imported data which was basis for all further calculations:

  df <- C$data[C$data[,"analyte"]==A,1:7,drop=FALSE]
  if (knitr::is_html_output()) {
    eCerto:::styleTabC0(x = df[, c("ID", "Lab", "value", "unit", "replicate", "File")], ap = D, type = "standard")
  } else if (knitr::is_latex_output()) {
    knitr::kable(df, row.names=FALSE, format="latex", format.args = list(decimal.mark = "."))
  } else {
    knitr::kable(df, row.names=FALSE, format="pipe", format.args = list(decimal.mark = "."))
  }

Statistics regarding lab means, lab variances and outlier detection

  df <- CP$stats
  if (knitr::is_html_output()) {
    eCerto:::styleTabC1(x = df, n = D[["precision"]])
  } else if (knitr::is_latex_output()) {
    knitr::kable(df, row.names=FALSE, format="latex", format.args = list(decimal.mark = "."))
  } else {
    knitr::kable(df, row.names=FALSE, format="pipe", format.args = list(decimal.mark = "."))
  }

r ifelse(!is.null(D$sample_filter), "The following samples (IDs) have been removed by the user upon inspection of the oulier statistics:", "")

cat(paste(D$sample_filter, collapse=", ")) 

Statistics regarding overall mean distribution and variance testing

df <- CP$mstats
  if (knitr::is_html_output()) {
    eCerto:::styleTabC2(x = df, n = D[["precision"]])
  } else if (knitr::is_latex_output()) {
    knitr::kable(df, row.names=FALSE, format="latex", format.args = list(decimal.mark = "."))
  } else {
    knitr::kable(df, row.names=FALSE, format="pipe", format.args = list(decimal.mark = "."))
  }

r ifelse(!is.null(D$lab_filter), "The following Labs (IDs) have been removed by the user upon inspection of the oulier statistics:", "")

cat(paste(D$lab_filter, collapse=", ")) 

Certified Values Plot

  CertValPlot <- eval(parse(text=CP$CertValPlot$fnc))
  data <- C$data[C$data[,"analyte"]==A,,drop=FALSE]
  data[,"L_flt"] <- data[,"Lab"] %in% D$lab_filter
  data <- data[!(data[,"ID"] %in% D$sample_filter),]
  # re-factor Lab to ensure that only Labs with data are depicted
  data[,"Lab"] <- factor(data[,"Lab"])
  eval(CP$CertValPlot$call)

Certified Value and uncertainty contributions

Here we could include the Tab.3 from the App including the certified values. However, this might be better done in the Material Report/Certificate.



Try the eCerto package in your browser

Any scripts or data that you put into this service are public.

eCerto documentation built on April 12, 2025, 9:13 a.m.