Debian Codegraph @

R/package.R

raw
1 #' A general-purpose tool for dynamic report generation in R
2 #'
3 #' The \pkg{knitr} package is an implementation of Literate Programming, a
4 #' programming paradigm that intermingle code chunks (for computing) with prose
5 #' (for documentation) in the same document.
6 #'
7 #' When the document is compiled, the code chunks can be executed, and the
8 #' results from computing (text or graphics) are automatically written to the
9 #' output along with the prose.
10 #'
11 #' This package is an alternative tool to Sweave with a more flexible design and
12 #' new features like caching and finer control of graphics. It is not limited to
13 #' LaTeX and is ready to be customized to process other file formats. See the
14 #' package website in the references for more information and examples.
15 #' @name knitr-package
16 #' @aliases knitr
17 #' @import graphics grDevices stats utils
18 #' @author Yihui Xie <\url{https://yihui.org}>
19 #' @seealso The core function in this package: \code{\link{knit}}. If you are an
20 #' Sweave user, see \code{\link{Sweave2knitr}} on how to convert Sweave files
21 #' to \pkg{knitr}.
22 #' @note The pronunciation of \pkg{knitr} is similar to \emph{neater} or you can
23 #' think of \emph{knitter} (but it is \emph{single t}). The name comes from
24 #' \code{knit} + \code{R} (while \code{Sweave} = \code{S} + \code{weave}).
25 #' @references Full documentation and demos: \url{https://yihui.org/knitr/};
26 #' FAQ's: \url{https://yihui.org/knitr/faq/}
27 #' @importFrom xfun file_ext html_escape is_windows loadable parse_only
28 #' sans_ext try_silent with_ext read_utf8 write_utf8 file_string
29 #' is_R_CMD_check is_abs_path
30 '_PACKAGE'
31
32 .knitEnv = new.env()
33
34 .knitEnv$meta = list()
35
36 # no partial matching for lists!!
37 #' @export
38 `$.knitr_strict_list` = function(x, name) x[[name]]
39
40 as.strict_list = function(x) {
41 if (!is.list(x)) stop("'x' is not a list")
42 class(x) = 'knitr_strict_list'
43 x
44 }