Knowledge

Knitr

Source 📝

1098: 112: 27: 1041: 542: 315:
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
311:
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
237:, 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 (used in reports published on RPubs), caching, 316:
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.
1082: 506: 294:
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
308:
The implementation of logical conditions in R can provide text elements for the dynamic report depended on the statistical analysis. For example:
1158: 1193: 1139: 325: 1188: 1183: 1075: 597: 883: 499: 523: 1163: 1068: 283: 268: 1178: 492: 361: 1132: 550: 132: 765: 676: 1173: 1105: 242: 479: 1020: 775: 750: 91: 1125: 65: 378: 1168: 876: 223: 515: 187: 125: 689: 276: 869: 330: 215: 1097: 821: 280: 219: 304:
creates output data (e.g. descriptive analysis) or output graphics (e.g. boxplot diagram).
8: 111: 760: 357: 351: 1048: 632: 563: 211: 144: 780: 612: 602: 179: 1113: 1109: 1056: 1052: 911: 795: 755: 694: 622: 234: 137: 1152: 921: 849: 558: 254: 816: 790: 740: 587: 484: 475: 466: 401: 258: 26: 785: 745: 709: 994: 770: 704: 34: 999: 906: 831: 800: 648: 642: 637: 592: 579: 402:"Knitr: A General-Purpose Package for Dynamic Report Generation in R" 183: 39: 1040: 942: 916: 826: 699: 617: 207: 203: 379:"knitr: A General-Purpose Tool for Dynamic Report Generation in R" 1004: 926: 724: 654: 457: 265: 149: 100: 978: 973: 952: 947: 719: 714: 569: 531: 470: 461: 416: 386: 230: 892: 659: 607: 250: 191: 684: 627: 246: 238: 199: 160: 450: 541: 272: 195: 861: 431: 1150: 241:graphics and support to other languages such as 353:Dynamic Documents with R and knitr, 2nd Edition 233:and written with a different design for better 182:for dynamic report generation with R. It is a 1133: 1076: 877: 500: 514: 214:documents. The purpose of knitr is to allow 1140: 1126: 1083: 1069: 884: 870: 507: 493: 110: 25: 429: 414: 190:that enables integration of R code into 1159:Free R (programming language) software 1151: 417:"R Markdown — Dynamic Documents for R" 865: 488: 264:knitr is officially supported in the 1092: 1035: 289: 1194:Free and open-source software stubs 349: 13: 14: 1205: 442: 1096: 1039: 540: 312:and data2" cannot be rejected. 1189:Computer programming tool stubs 376: 16:Report generation engine with R 1184:Software using the GPL license 423: 408: 394: 370: 343: 1: 1106:free and open-source software 336: 1112:. You can help Knowledge by 1055:. You can help Knowledge by 1021:LaTeX Project Public License 432:"Easy web publishing from R" 301:performs data processing and 186:in the programming language 7: 319: 222:. It is licensed under the 10: 1210: 1091: 1034: 356:. Chapman & Hall/CRC. 326:The R Programming wikibook 224:GNU General Public License 218:in R through the means of 71:1.43 / 26 May 2023 1164:Free statistical software 1013: 987: 961: 935: 899: 891: 841: 809: 733: 675: 578: 549: 538: 522: 155: 143: 131: 121: 90: 86: 64: 60: 49:17 January 2012 45: 33: 24: 1179:R (programming language) 516:R (programming language) 690:Emacs Speaks Statistics 73:; 15 months ago 1051:-related article is a 834:(formerly RStudio PBC) 229:knitr was inspired by 331:Reproducible research 216:reproducible research 1174:Literate programming 822:Revolution Analytics 404:. 29 September 2021. 220:literate programming 566:(Revolution R Open) 350:Xie, Yihui (2015). 21: 286:for data science. 35:Original author(s) 19: 1169:Free TeX software 1121: 1120: 1064: 1063: 1029: 1028: 962:LaTeX integration 859: 858: 761:Dirk Eddelbuettel 290:Workflow of knitr 173: 172: 1201: 1142: 1135: 1128: 1100: 1093: 1085: 1078: 1071: 1049:programming-tool 1043: 1036: 988:Conversion tools 886: 879: 872: 863: 862: 766:Robert Gentleman 564:Microsoft R Open 544: 509: 502: 495: 486: 485: 454: 453: 451:Official website 436: 435: 427: 421: 420: 412: 406: 405: 398: 392: 391: 383: 374: 368: 367: 347: 212:reStructuredText 169: 166: 164: 162: 114: 109: 106: 104: 102: 81: 79: 74: 56: 54: 29: 22: 18: 1209: 1208: 1204: 1203: 1202: 1200: 1199: 1198: 1149: 1148: 1147: 1146: 1090: 1089: 1032: 1030: 1025: 1009: 983: 957: 931: 895: 890: 860: 855: 837: 805: 781:Brian D. Ripley 729: 671: 574: 551:Implementations 545: 536: 518: 513: 449: 448: 445: 440: 439: 428: 424: 413: 409: 400: 399: 395: 381: 375: 371: 364: 348: 344: 339: 322: 313: 292: 180:software engine 159: 117: 99: 82: 77: 75: 72: 52: 50: 46:Initial release 17: 12: 11: 5: 1207: 1197: 1196: 1191: 1186: 1181: 1176: 1171: 1166: 1161: 1145: 1144: 1137: 1130: 1122: 1119: 1118: 1101: 1088: 1087: 1080: 1073: 1065: 1062: 1061: 1044: 1027: 1026: 1024: 1023: 1017: 1015: 1011: 1010: 1008: 1007: 1002: 997: 991: 989: 985: 984: 982: 981: 976: 971: 965: 963: 959: 958: 956: 955: 950: 945: 939: 937: 936:Macro packages 933: 932: 930: 929: 924: 919: 914: 909: 903: 901: 897: 896: 889: 888: 881: 874: 866: 857: 856: 854: 853: 845: 843: 839: 838: 836: 835: 829: 824: 819: 813: 811: 807: 806: 804: 803: 798: 796:Hadley Wickham 793: 788: 783: 778: 773: 768: 763: 758: 756:Peter Dalgaard 753: 748: 743: 737: 735: 731: 730: 728: 727: 722: 717: 712: 707: 702: 697: 695:Java GUI for R 692: 687: 681: 679: 673: 672: 670: 669: 668: 667: 662: 657: 645: 640: 635: 630: 625: 620: 615: 610: 605: 600: 595: 590: 584: 582: 576: 575: 573: 572: 567: 561: 555: 553: 547: 546: 539: 537: 535: 534: 528: 526: 520: 519: 512: 511: 504: 497: 489: 483: 482: 473: 464: 455: 444: 443:External links 441: 438: 437: 430:RStudio, Inc. 422: 415:RStudio, Inc. 407: 393: 369: 362: 341: 340: 338: 335: 334: 333: 328: 321: 318: 310: 306: 305: 302: 299: 291: 288: 235:modularization 171: 170: 157: 153: 152: 147: 141: 140: 138:Cross-platform 135: 129: 128: 123: 119: 118: 116: 115: 96: 94: 88: 87: 84: 83: 70: 68: 66:Stable release 62: 61: 58: 57: 47: 43: 42: 37: 31: 30: 15: 9: 6: 4: 3: 2: 1206: 1195: 1192: 1190: 1187: 1185: 1182: 1180: 1177: 1175: 1172: 1170: 1167: 1165: 1162: 1160: 1157: 1156: 1154: 1143: 1138: 1136: 1131: 1129: 1124: 1123: 1117: 1115: 1111: 1108:article is a 1107: 1102: 1099: 1095: 1094: 1086: 1081: 1079: 1074: 1072: 1067: 1066: 1060: 1058: 1054: 1050: 1045: 1042: 1038: 1037: 1033: 1022: 1019: 1018: 1016: 1012: 1006: 1003: 1001: 998: 996: 993: 992: 990: 986: 980: 977: 975: 972: 970: 967: 966: 964: 960: 954: 951: 949: 946: 944: 941: 940: 938: 934: 928: 925: 923: 920: 918: 915: 913: 910: 908: 905: 904: 902: 898: 894: 887: 882: 880: 875: 873: 868: 867: 864: 852: 851: 850:The R Journal 847: 846: 844: 840: 833: 830: 828: 825: 823: 820: 818: 815: 814: 812: 810:Organisations 808: 802: 799: 797: 794: 792: 789: 787: 784: 782: 779: 777: 776:Thomas Lumley 774: 772: 769: 767: 764: 762: 759: 757: 754: 752: 751:John Chambers 749: 747: 744: 742: 739: 738: 736: 732: 726: 723: 721: 718: 716: 713: 711: 708: 706: 703: 701: 698: 696: 693: 691: 688: 686: 683: 682: 680: 678: 674: 666: 663: 661: 658: 656: 653: 652: 651: 650: 646: 644: 641: 639: 636: 634: 631: 629: 626: 624: 621: 619: 616: 614: 611: 609: 606: 604: 601: 599: 596: 594: 591: 589: 586: 585: 583: 581: 577: 571: 568: 565: 562: 560: 559:Distributed R 557: 556: 554: 552: 548: 543: 533: 530: 529: 527: 525: 521: 517: 510: 505: 503: 498: 496: 491: 490: 487: 481: 477: 476:knitr package 474: 472: 468: 465: 463: 459: 456: 452: 447: 446: 433: 426: 418: 411: 403: 397: 389: 388: 380: 373: 365: 363:9781498716963 359: 355: 354: 346: 342: 332: 329: 327: 324: 323: 317: 309: 303: 300: 297: 296: 295: 287: 285: 282: 278: 274: 270: 267: 262: 261:, and so on. 260: 256: 255:Shell scripts 252: 248: 244: 240: 236: 232: 227: 225: 221: 217: 213: 209: 205: 201: 197: 193: 189: 185: 181: 177: 168: 158: 154: 151: 148: 146: 142: 139: 136: 134: 130: 127: 124: 120: 113: 108: 98: 97: 95: 93: 89: 85: 69: 67: 63: 59: 48: 44: 41: 38: 36: 32: 28: 23: 1114:expanding it 1103: 1057:expanding it 1046: 1031: 968: 848: 842:Publications 817:R Consortium 791:Luke Tierney 741:Roger Bivand 664: 647: 588:Bibliometrix 467:Example code 425: 410: 396: 385: 377:Xie, Yihui. 372: 352: 345: 314: 307: 293: 263: 259:CoffeeScript 228: 175: 174: 786:Julia Silge 746:Jenny Bryan 710:R Commander 1153:Categories 995:LaTeX2HTML 771:Ross Ihaka 705:Rattle GUI 677:Interfaces 458:Repository 337:References 298:load data, 122:Written in 92:Repository 78:2023-05-26 53:2012-01-17 1000:LaTeX2RTF 907:AMS-LaTeX 832:Posit PBC 801:Yihui Xie 649:tidyverse 643:Statcheck 638:SimpleITK 593:easystats 281:Architect 277:Emacs/ESS 40:Yihui Xie 943:PGF/TikZ 917:Powerdot 827:R-Ladies 700:KH Coder 618:Rmetrics 580:Packages 524:Features 320:See also 279:and the 208:AsciiDoc 204:Markdown 1014:Related 1005:LaTeXML 927:AMSRefs 900:Classes 725:RStudio 655:ggplot2 271:for R, 266:RStudio 184:package 156:Website 150:GNU GPL 145:License 76: ( 51: ( 979:Sweave 974:Pandoc 953:REVTeX 948:PSfrag 912:Beamer 734:People 720:RKWard 715:RExcel 570:Renjin 532:Sweave 471:GitHub 462:GitHub 387:GitHub 360:  243:Python 231:Sweave 210:, and 165:/knitr 107:/knitr 105:/yihui 101:github 1104:This 1047:This 969:knitr 922:Biber 893:LaTeX 665:knitr 660:dplyr 633:Shiny 608:RGtk2 382:(PDF) 192:LaTeX 178:is a 176:knitr 161:yihui 20:knitr 1110:stub 1053:stub 685:Bio7 628:RQDA 613:Rhea 603:lumi 598:qdap 480:CRAN 358:ISBN 257:and 247:Perl 239:TikZ 200:HTML 163:.org 133:Type 103:.com 623:rnn 478:on 469:on 460:on 284:IDE 273:LyX 269:IDE 251:C++ 196:LyX 1155:: 384:. 275:, 253:, 249:, 245:, 226:. 206:, 202:, 198:, 194:, 1141:e 1134:t 1127:v 1116:. 1084:e 1077:t 1070:v 1059:. 885:e 878:t 871:v 508:e 501:t 494:v 434:. 419:. 390:. 366:. 188:R 167:/ 126:R 80:) 55:)

Index


Original author(s)
Yihui Xie
Stable release
Repository
github.com/yihui/knitr
Edit this at Wikidata
R
Type
Cross-platform
License
GNU GPL
yihui.org/knitr/
software engine
package
R
LaTeX
LyX
HTML
Markdown
AsciiDoc
reStructuredText
reproducible research
literate programming
GNU General Public License
Sweave
modularization
TikZ
Python
Perl

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.