Here are the examples of the r api knitr-opts_knitget taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
12 Examples
19
File: randomNames.R, author: CenterForAssessment, license: GNU Lesser General Public License v3.0
is_html_output = function() {
knitr::opts_knit$get("rmarkdown.pandoc.to") == "html"
}
19
File: SGP.R, author: CenterForAssessment, license: GNU General Public License v3.0
is_html_output = function() {
knitr::opts_knit$get("rmarkdown.pandoc.to") == "html"
}
19
File: SGP_Data_Analysis.R, author: CenterForAssessment, license: GNU General Public License v3.0
is_html_output = function() {
knitr::opts_knit$get("rmarkdown.pandoc.to") == "html"
}
19
File: SGP_Data_Preparation.R, author: CenterForAssessment, license: GNU General Public License v3.0
is_html_output = function() {
knitr::opts_knit$get("rmarkdown.pandoc.to") == "html"
}
19
File: toOrdinal.R, author: CenterForAssessment, license: GNU Lesser General Public License v3.0
is_html_output = function() {
knitr::opts_knit$get("rmarkdown.pandoc.to") == "html"
}
19
File: utils-rmd.R, author: datacamp, license: GNU Affero General Public License v3.0
build_doc_structure < - function(text) {
old.format < - knitr::opts_knit$get()
knitr::opts_knit$set(out.format = "markdown")
apat < - knitr::all_patterns
opat < - knitr::knit_patterns$get()
on.exit({
knitr::knit_patterns$restore(opat)
knitr:::chunk_counter(reset = TRUE)
knitr:::knit_code$restore(list())
knitr::opts_knit$set(old.format)
})
knitr::pat_md()
content = knitr:::split_file(lines = knitr:::split_lines(text))
code_chunks < - knitr:::knit_code$get()
for (i in seq_along(content)) {
if (class(content[[i]]) == "block") {
label < - content[[i]]$params$label
content[[i]]$input < - paste(code_chunks[[label]],
collapse = "\n")
}
}
content[sapply(content, function(part) {
all(grepl(pattern = "^\\s*$", x = part$input.src)) &&
class(part) == "inline"
})] < - NULL
return(content)
}
19
File: _common.R, author: jrnold, license: MIT License
is_html < - knitr::opts_knit$get("rmarkdown.pandoc.to") == "html"
19
File: helpers.R, author: maxheld83, license: GNU Affero General Public License v3.0
is_html < - function() {
isTRUE(knitr::opts_knit$get("rmarkdown.pandoc.to") == "html")
}
19
File: rxode-options.R, author: nlmixrdevelopment, license: GNU General Public License v3.0
rxSuppressMsg < - function() {
if (requireNamespace("knitr", quietly = TRUE)) {
if (!is.null(knitr::opts_knit$get("rmarkdown.pandoc.to"))) {
return(invisible(NULL))
}
else {
rxSetSilentErr(as.integer(length(capture.output(message(" "),
type = "message")) == 0L))
}
}
else {
rxSetSilentErr(as.integer(length(capture.output(message(" "),
type = "message")) == 0L))
}
invisible(NULL)
}
19
File: _common.R, author: pzhaonet, license: MIT License
doc_type < - function() knitr::opts_knit$get("rmarkdown.pandoc.to")
19
File: sp_color_markdown_text.R, author: smithjd, license: MIT License
sp_color_markdown_text < - function(x, color) {
outputFormat = knitr::opts_knit$get("rmarkdown.pandoc.to")
if (outputFormat == "latex")
paste0("\\textcolor{", color, "}{", x, "}")
else if (outputFormat == "html")
paste0(" < font color='", color, "'>", x, " < /font>")
else x
}
19
File: _common.R, author: XiangyunHuang, license: MIT License
doc_type < - function() knitr::opts_knit$get("rmarkdown.pandoc.to")