createCustomRmd: Function to create custom rmd file for reprot generation

Description Usage Arguments Details Value Author(s) Examples

View source: R/Rmd_customFunction.R

Description

Function to create Rmd file and HTML output

Usage

1
2
3
4
5
createCustomRmd(code = "", sectionHash = "#", comment_after = "",
  comment_prior = "", chunkopts = "echo=FALSE,warnings=FALSE,message=FALSE",
  sectionHeader = "R markdown section", chunkVar = "",
  outRmd = "test.Rmd", outRmdDir = ".", append = F, renderOutput = F,
  browse = interactive(), logo = "", projectCode = "QXXXX")

Arguments

code

R code(in quotes) to produce the desired out. This option takes '\'r (blackslashfollowed by r, without quotes) as line break.

sectionHash

hash to indicate subsection # is section 1 and ## subsection of previous section [default #]

comment_after

Text to appear after the plot

comment_prior

Text to appear above the plot

sectionHeader

section title

chunkVar

chunck variable name in single quote. This value is used as suffix to generate plot output files.

outRmd

Name of the output rmd file

outRmdDir

Path to output folder to save all outputs and Rmd file [Default = current working folder]

append

A logical value to append existing file or generate new file. [Default =F, generate new file]

renderOutput

A logical value to render the generated Rmd to HTML document.

browse

A logical value to open the generated HTML document in browser.

logo

Path to logo file

projectCode

Qbic project code

chuckopts

R code chunck options in quotes [Default= "echo=FALSE,warnings=FALSE,message=FALSE"]

Details

This function isinspried from function in R packgae regionReprot

Value

Generate a Rmd file and render it to HTML.

Author(s)

Praveen baskaran spemannpraveen@gmail.com

Examples

1
2
3
4
 createCustomRmd(code = "plot(1:10,1:10)\rplot(1:20,1:20)",append = F,outRmd = "Testing.Rmd",outRmdDir  = "../",chunkopts ="echo=FALSE")
 createCustomRmd(code = "for(i in 1:12){\rprint(i)\r}",append = T,sectionHeader = "heatmap",comment_after = "heatmap",outRmd = "Testing.Rmd",outRmdDir  = "../")
 createCustomRmd(code="plot(1:100,1:100)",sectionHash = "##",comment_prior = "This is a test",append = T,renderOutput = F,outRmd = "Testing.Rmd",sectionHeader = "subheader",outRmdDir  = "../")
 createCustomRmd(code="",append = T,renderOutput = T,outRmd = "Testing.Rmd",outRmdDir  = "../",projectCode="QXXXX")

praveenbas/myRmdFunctions documentation built on May 23, 2019, 1:24 p.m.