# yihui/knitr

A general-purpose tool for dynamic report generation in R

Repository: https://github.com/yihui/knitr
Canonical: https://ross.abutalabs.com/products/knitr
Homepage: https://yihui.org/knitr/
Language: R
License Family: other
Topics: knitr, r, literate-programming, sweave, rmarkdown, dynamic-documents, r-package
Last push: 2026-08-26T19:13:16+00:00

## Health v2 (maintenance only)
Score: 75/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 30, longevity 100
- inputs: {"age_days": 5434, "days_push": 7, "days_rel": 256, "gap_med": 203.0, "n_releases_24m": 3}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2465, forks 879 (observed 2026-08-28T04:06:53.622738+00:00)

## What it is
knitr is an R package for literate programming and dynamic report generation, weaving code chunks from R (and other languages like Python or shell) into output documents in LaTeX, HTML, Markdown, and other markup formats. It is the engine underlying R Markdown and offers flexible chunk options, caching, and graphics device control.

## Use cases
- generate reproducible reports that embed R code and results
- weave R code into LaTeX or Markdown documents
- create dynamic documents with plots and inline computed values
- build R Markdown documents with knitr as the engine
- cache expensive code chunk results in a report
- write tutorials or books mixing prose and executable code
- migrate from Sweave to a more flexible literate programming tool

## When to choose
- you need reproducible research documents combining code, output, and narrative
- you use R Markdown, Quarto, or RStudio and need a weaving engine
- you want fine-grained control over chunk options, graphics devices, and output hooks
- you need to embed multiple languages (R, Python, shell) in one document

## When to avoid
- you need a general-purpose static site generator without code execution
- your project does not involve R or document weaving
- you only need simple templating without code evaluation

## Facets
- artifact type: library
- maturity: stable
- function: documentation, data-visualization, templating, static-site-generator
- domain: data-science, documentation, developer-tools, education
- platform: cross-platform
- tags: literate-programming, rmarkdown, reproducible-research, dynamic-reports, sweave, code-chunks, report-generation, r

## Member repositories
- yihui/knitr (main) score 75

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:53.622738+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:29:15.322742+00:00, confidence not recorded.
  - readme: https://github.com/yihui/knitr (fetched 2026-08-28T04:06:53.622738+00:00, sha d3c36b560d9f)
  - homepage: https://yihui.org/knitr/ (fetched 2026-08-29T10:10:45.579325+00:00, sha c9622b432fdf)
  - site_page: https://yihui.org/knitr/faq (fetched 2026-08-29T10:10:45.588437+00:00, sha 3ce04644f3bc)
- Data as of 2026-08-30T08:39:29.467469+00:00.
