请输入您要查询的百科知识:

 

词条 Knitr
释义

  1. Workflow of KnitR

  2. See also

  3. References

  4. External links

{{Infobox software
| title = knitr
| name = knitr
| logo =
| logo caption =
| screenshot = Screenshot-knitr-RStudio.png
| caption =
| collapsible =
| author = Yihui Xie
| developer =
| released = {{Start date|2012|01|17|df=yes}}
| discontinued =
| latest release version = 1.18
| latest release date = {{Start date and age|2017|12|27|df=yes}}
| latest preview version =
| latest preview date =
| status =
| programming language = R
| operating system =
| platform =
| size =
| language =
| language count =
| language footnote =
| genre = Cross-platform
| license = GNU GPL
| alexa =
| website = {{URL|https://yihui.name/knitr}}
}}knitr is an engine for dynamic report generation with R.[1][2] It is a package in the statistical programming language R that enables integration of R code into LaTeX, LyX, HTML, Markdown, AsciiDoc, and reStructuredText documents. The purpose of knitr is to allow reproducible research in R through the means of Literate Programming. It is licensed under the GNU General Public License.[3]

knitr was inspired by Sweave and written with a different design for better modularization, so it is easier to maintain and extend. Sweave can be regarded as a subset of knitr in the sense that all features of Sweave are also available in knitr. Some of knitr's extensions include the R Markdown format[4] (used in reports published on RPubs[5]), caching, TikZ graphics and support to other languages such as Python, Perl, C++, Shell scripts and CoffeeScript, and so on.

knitr is officially supported in the RStudio IDE for R, LyX, Emacs/ESS and the Architect IDE for data science.

Workflow of KnitR

KnitR consists of standard e.g. MarkDown document with R-code chunks integrated in the document. The code chunks can be regarded as R-scripts that

  • load data,
  • performs data processing and
  • creates output data (e.g. descriptive analysis) or output graphics (e.g. boxplot diagram).

The implementation of logical conditions in R can provide text elements for the dynamic report depended on the statistical analysis.

The following text is as stan

    The Wilcoxon Sign test was applied as statistical comparison of the average of two dependent samples above.     In this case then, the calculated P-value was 0.56 and hence greater than the significance (0.05 by default).    This implies that "H0: there is no difference between the        results in data1 and data2" must be accepted. 

Depending on the R results (here 0.56) the text fragments are determined by logical conditions in the R-script. If the P-value were 0.04, which is lower than the significance (0.05 by default), an other appropriate text fragment would get inserted in the dynamic report. By this workflow the replacement of the input data of the statistical or numerical analysis in R creates a reproducible report which the same methodology.

See also

  • The R Programming wikibook
  • Reproducible research

References

1. ^{{cite book|last=Xie|first=Yihui|title=Dynamic Documents with R and knitr, 2nd Edition|year=2015|publisher=Chapman & Hall/CRC|isbn=9781498716963|url=http://www.crcpress.com/product/isbn/9781498716963}}
2. ^{{cite web|last=Xie|first=Yihui|title=knitr: A General-Purpose Tool for Dynamic Report Generation in R|url=https://github.com/yihui/knitr/releases/download/doc/knitr-manual.pdf}}
3. ^https://cran.r-project.org/package=knitr
4. ^{{cite web|last=RStudio, Inc|title=R Markdown — Dynamic Documents for R|url=http://rmarkdown.rstudio.com}}
5. ^{{cite web|last=RStudio, Inc|title=Easy web publishing from R|url=http://www.rpubs.com/}}

External links

  • {{Official website|http://yihui.name/knitr/}}
  • [https://github.com/yihui/knitr Repository] on GitHub
  • [https://github.com/yihui/knitr-examples/ Example code] on GitHub
  • [https://cran.r-project.org/package=knitr knitr package] on CRAN
{{LaTeX navbox}}{{programming-software-stub}}

5 : Free R (programming language) software|Free statistical software|Free TeX software|Literate programming|R (programming language)

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/11 23:58:38