setup_MarkdownReports: setup_MarkdownReports

Description Usage Arguments Examples

View source: R/MarkdownReportsDev.R

Description

Setup the markdown report file and the output directory, create a sub directory in "OutDir". Its name is stamped with the script name and the modification time. Create the "path_of_report" variable used by all log-writing and ~wplot functions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
setup_MarkdownReports(
  OutDir = getwd(),
  scriptname = basename(OutDir),
  title = "",
  setDir = TRUE,
  recursive.folder = TRUE,
  backupfolder = TRUE,
  append = FALSE,
  addTableOfContents = FALSE,
  saveSessionInfo = TRUE,
  saveParameterList = "p",
  b.defSize = c(def = 7, A4 = 8.27, `1col.nature` = 3.5, `2col.nature` = 7.2,
    `1col.cell` = 3.35, `1.5col.cell` = 4.49, `2col.cell` = 6.85)[1],
  b.defSize.fullpage = 8.27,
  b.usepng = FALSE,
  b.png4Github = FALSE,
  b.mdlink = TRUE,
  b.save.wplots = TRUE,
  b.def.color = "gold1"
)

Arguments

OutDir

The output directory (absolute / full path).

scriptname

Name of the script file you are running. This filename is written in the title field of .pdf files, so that you know which script generated that file. Example: "GeneFilt.hist by MyFilteringScript".

title

Manually set the title of the report.

setDir

Set the working directory to OutDir? Default: TRUE

recursive.folder

Create output folder recursively, if parent folders do not exist. Parameter for dir.create(). Use continue_logging_markdown() if you return logging into an existing report. FALSE by default: rerunning the script overwrites the previous report. Archive reports manually into the timestamped subfolder within the OutDir.

backupfolder

Create a time-stamped backup folder inside the working directory (OutDir).

append

Set append to TRUE if you do not want to overwrite the previous report.

addTableOfContents

write 'TOC' below the header of the file, This is compiled to a proper Table Of Contents by, e.g. Typora.

saveSessionInfo

save 'sessioninfo::session_info()' results to '.session_info.DATE.txt.gz'

saveParameterList

save the list of parameters stored in the variable name provides ("p" by default) as a table in the markdown report. Uses the md.LogSettingsFromList() function. Set to FALSE to disable this option.

b.defSize

Default width of plot EXCEPT in pdfA4plot_on(), assuming h = w by default. c("def" = 7, "A4" = 8.27, "1col.nature" = 3.50, "2col.nature" = 7.20, "1col.cell" = 3.35, "1.5col.cell" = 4.49, "2col.cell" = 6.85)

b.defSize.fullpage

Default width of plot in pdfA4plot_on()A global background variable used by pdfA4plot_on.

b.usepng

A global background variable used by the plotting functions. If TRUE, a link to the .png versions of the saved plot will be created. The .png file itself is not created.

b.png4Github

A global background variable used by the plotting functions. If TRUE (default), the link to the .png versions of the saved plot will be created in a GitHub compatible format. That means, when you upload your markdown report and the .png images to your GitHub wiki under "Reports/" the links will correctly display the images online.

b.mdlink

A global background variable used by the plotting functions. If TRUE (default), all saved (.pdf) plots will be linked into your report.

b.save.wplots

A global background variable used by the plotting functions. If TRUE (default), plots will be saved to a .pdf file.

b.def.color

Set the default color for all wplot* functions.

Examples

1
2
setup_MarkdownReports( scriptname = "MyRscript.R", title = "Awesome Ananlysis",
append = TRUE, b.png4Github = TRUE)

vertesy/MarkdownReportsDev documentation built on Nov. 15, 2021, 9:59 a.m.