Knitr

Source: Wikipedia, the free encyclopedia.
knitr
Original author(s)Yihui Xie
Initial release17 January 2012 (2012-01-17)
Stable release
1.43 / 26 May 2023; 10 months ago (2023-05-26)
Repository
Written in
GNU GPL
Websiteyihui.org/knitr/

knitr is an engine for dynamic report generation with R.

reproducible research in R through the means of literate programming. It is licensed under the GNU General Public License.[3]

knitr was inspired by

, 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. For example:

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

The text fragments are selected according to the script's results. In this example, if the P-value was lower than the significance level, different text fragments would be inserted in the dynamic report. In particular, the second sentence would swap "less" for "greater," and the third sentence would be replaced to reflect rejection of the null hypothesis. Using this workflow allows creating new reports simply by supplying new input data, ensuring the methodology is reproduced identically.

See also

References

External links


This page is based on the copyrighted Wikipedia article: Knitr. Articles is available under the CC BY-SA 3.0 license; additional terms may apply.Privacy Policy