Enhancing Clinical Reporting Accessibility through Web-Based R Integration
2024-10-30
Project Tech Lead, NEST @ Roche
π https://insightsengineering.github.io/tlg-catalog
The TLG Catalog serves as a comprehensive repository of Tables, Listings, and Graphs (TLGs) used in clinical reporting, created using R packages.
random.cdisc.data
package).lock
file)WebR is a framework that ports R to WebAssembly (WASM), allowing R code to run in web browsers without requiring local installations. This enhances accessibility, particularly in environments with centrally managed systems or limited access rights on local machines.
For more information, visit the official documentation: WebR Documentation and George Staggβs presentations: Introduction to WebR, Shiny Without a Server.
Powered by WebR, Shinylive enables Shiny applications to run directly in the browser. This allows for publishing Shiny apps without the need for a server.
Both WebR and Shinylive integrate directly with Quarto through extensions, enabling easy embedding of R code that runs in the browser. This allows for efficient creation of dynamic, reproducible documents.
For more details, visit: coatless/quarto-webr
and quarto-ext/shinylive
.
REPL - Read - Eval - Print - Loop
β οΈ WebR code chunks are not executable during render process thus not testable.
β οΈ We want to know whether the examples code does not throw errors (e.g. due to a new package version).
β Solution: keep both
knitr::knit_code$get()
results = "asis"
to dynamically create WebR code chunks```{r setup}
library(dplyr)
(...)
```
```{r output}
tbl <- ...
tbl
```
```{r webr-constructor, echo = FALSE, results = "asis"}
code_chunk_id <- c("setup", "output")
code_chunk_content <- lapply(code_chunk_id, knitr::knit_code$get)
final_code_chunk <- unlist(c(
"```{webr-r}",
code_chunk_content,
"```"
))
cat(final_code_chunk, sep = "\n")
```
File: my_article.qmd
WebR integration makes the TLG Catalog more accessible and encourages more user interaction.
The interactive nature of WebR enhances learning and usability, making it a powerful addition for training and experimentation in clinical reporting.
WebR is a native web technology. It should be possible to to integrate into websites created via pkgdown
. π r-lib/pkgdown#2348
roxy.shinylive
Embed Shinylive application(s) in the roxygen2
package documentation, vigniettes, README, etc.
R/Pharma 2024