Open ArthurData opened 2 years ago
If its a technical report
---
title: "My report"
author: "Arthur Bréant"
date: "1/13/2022"
logo: "`r system.file('logo', 'logo.svg', package = 'finddxtemplate')`"
output: finddxtemplate::html_document_find
---
```{r, include = FALSE}
knitr::opts_chunk$set(
echo = FALSE
)
For word. You can add your template inside the package "inst/"
Tell the users how to use it
file.copy(system.file("my_finddx_template.docx", package = "finddxtemplate"), path/where_i_want/my_finddx_template.docx)
Maybe this works
title: "My report"
author: "Arthur Bréant"
date: "1/13/2022"
output:
word_document:
reference_docx: `r system.file("my_finddx_template.docx", package = "finddxtemplate"))`
---
```{r, include = FALSE}
knitr::opts_chunk$set(
echo = FALSE
)
For PDF:
pagedown::chrome_print("path/to/html/file.html")
You can add your templates that are ready inside "inst/rmarkdown/templates"
like here: https://github.com/ThinkR-open/fusen/tree/main/inst/rmarkdown/templates/additional
Add in your templates
library(mypalettepackage)
use different color palettes
scale_()
functions like in : https://github.com/emilyriederer/Rtistic/
my_theme()
can be a function of your package
my_theme <- theme(
background.color = "red"
)
ggplot2::theme_set(my_theme())
opts <- options() # save old options
options(ggplot2.continuous.colour="viridis") options(ggplot2.continuous.fill = "viridis")
For instance, if you have
scale_color_discrete_finddx <- function(palette = "test", extend = FALSE, ...){
pal <- retrieve_palette(palette, "base") ggplot2::discrete_scale("colour", "test", manual_pal_flex(pal, extend), na.value = "grey50", ...)
}
options(ggplot2.continuous.colour="finddx")
According to the intended use is there a possibility to have 3 different report styles based on intended use?
Some features to add:
1/ When a formal report is needed, tables usually are short and descriptive , created with
{gtsummary}
package functions and all table packages. Is it possible to import them in the package, or we should install the packages in the rmd code chunks?2/ For formal report, possibility to add a list of authors with affiliations?