| mkdCodeChunkCommented,easyreporting-method {easyreporting} | R Documentation |
it creates a complete code chunk, adding a natural language comment before of it.
## S4 method for signature 'easyreporting' mkdCodeChunkCommented( object, comment = NULL, code, optionList = getOptionsList(object), sourceFilesList = NULL )
object |
an easyreporting class object |
comment |
a string with the natural language comment for the chunk. |
code |
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. |
none
## Not run:
rd <- easyreporting(filenamePath="./project_report",
title="example_report", author=c("It's me"))
optList <- makeOptionsList(includeFlag=TRUE, cacheFlag=TRUE)
mkdCodeChunkCommented(rd,
comment="This is the comment of the following code chunk",
code=c(quote(a <- 1), quote(b <- 2), quote(c <- a+b)),
optionList=optList, sourceFilesList=NULL)
mkdCodeChunkCommented(rd,
comment="This is the comment of the following code chunk",
code="a <- 1\n b <- 2\n(c <- a+b)\n", optionList=optList,
sourceFilesList=NULL)
## End(Not run)