mkdCodeChunkCommented,easyreporting-method {easyreporting} | R Documentation

## mkdCodeChunkCommented

### Description

it creates a complete code chunk, adding a natural language comment before of it.

### Usage

    ## S4 method for signature 'easyreporting'
    mkdCodeChunkCommented(
      object,
      commentMsg = NULL,
      codeMsg,
      optionList = getOptionsList(object),
      sourceFilesList = NULL
    )

### Arguments

`object` | an easyreporting class object
`commentMsg` | a string with the natural language comment for the chunk.
`codeMsg` | a string within the code.
`optionList` | a list of options (default is the class options).
`sourceFilesList` | a optional list of files to source inside the chunk.

### Value

none

### Examples

    rd <- easyreporting(filenamePath="./project_report",
                            title="example_report", author=c("It's me"))
    optList <- makeOptionsList(includeFlag=TRUE, cacheFlag=TRUE)
    mkdCodeChunkCommented(rd,
                    commentMsg="This is the comment of the following code chunk",
                    codeMsg="a <- 1\nb <- 2\n(c <- a+b)\n", optionList=optList,
                    sourceFilesList=NULL)

[Package easyreporting version 1.2.0 Index]