{"id":13654053,"url":"https://github.com/yihui/knitr","last_synced_at":"2026-10-19T08:06:02.640Z","repository":{"id":38715243,"uuid":"2594513","full_name":"yihui/knitr","owner":"yihui","description":"A general-purpose tool for dynamic report generation in R","archived":false,"fork":false,"pushed_at":"2026-10-01T04:38:49.000Z","size":9939,"stargazers_count":2467,"open_issues_count":3,"forks_count":877,"subscribers_count":112,"default_branch":"master","last_synced_at":"2026-10-07T16:41:33.862Z","etag":null,"topics":["dynamic-documents","knitr","literate-programming","r","r-package","rmarkdown","sweave"],"latest_commit_sha":null,"homepage":"https://yihui.org/knitr/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yihui.png","metadata":{"files":{"readme":"README-ES.md","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"claude":null,"gemini":null,"cursor":null,"copilot":".github/copilot-instructions.md","dco":null,"cla":null,"disclosure":null},"funding":{"github":["yihui"],"patreon":null,"custom":null}},"created_at":"2011-10-17T20:09:04.000Z","updated_at":"2026-10-06T17:56:56.000Z","dependencies_parsed_at":"2026-08-27T20:19:21.704Z","dependency_job_id":null,"html_url":"https://github.com/yihui/knitr","commit_stats":{"total_commits":6239,"total_committers":191,"mean_commits":32.66492146596859,"dds":"0.11828818720948875","last_synced_commit":"4510c09120c9f137859c9c56f497f9de6d92961f"},"previous_names":[],"tags_count":67,"template":false,"template_full_name":null,"purl":"pkg:github/yihui/knitr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yihui%2Fknitr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yihui%2Fknitr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yihui%2Fknitr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yihui%2Fknitr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yihui","download_url":"https://codeload.github.com/yihui/knitr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yihui%2Fknitr/sbom","scorecard":{"id":1239904,"data":{"date":"2025-11-10","repo":{"name":"github.com/yihui/knitr","commit":"707694c2e076370e0d23f62dbc9ca9ef71b2d2a6"},"scorecard":{"version":"v5.3.1-0.20251106164954-c65a663bf4a9","commit":"c65a663bf4a93c0f6eca32e6d34713d3e3440e11"},"score":3.9,"checks":[{"name":"Maintained","score":5,"reason":"3 commit(s) and 4 issue activity found in the last 90 days -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/R-CMD-check.yaml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/github-pages.yml:8","Warn: no topLevel permission defined: .github/workflows/knitr-examples.yaml:1","Warn: no topLevel permission defined: .github/workflows/lock.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":3,"reason":"Found 10/30 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/R-CMD-check.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/R-CMD-check.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/R-CMD-check.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/R-CMD-check.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:81: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/R-CMD-check.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-pages.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/github-pages.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-pages.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/github-pages.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/github-pages.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/github-pages.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/github-pages.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/github-pages.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/github-pages.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/github-pages.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-pages.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/github-pages.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-pages.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/github-pages.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/knitr-examples.yaml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/knitr-examples.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/knitr-examples.yaml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/knitr-examples.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/knitr-examples.yaml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/knitr-examples.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/knitr-examples.yaml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/knitr-examples.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/knitr-examples.yaml:63: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/knitr-examples.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/knitr-examples.yaml:94: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/knitr-examples.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lock.yaml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/yihui/knitr/lock.yaml/master?enable=pin","Info:   0 out of   7 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  12 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#sast"}}]},"last_synced_at":"2025-11-20T17:12:03.717Z","repository_id":38715243,"created_at":"2025-11-20T17:12:03.717Z","updated_at":"2025-11-20T17:12:03.717Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344872684,"owners_count":38351743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-19T02:00:06.414Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dynamic-documents","knitr","literate-programming","r","r-package","rmarkdown","sweave"],"created_at":"2024-08-02T02:01:22.630Z","updated_at":"2026-10-19T08:06:02.287Z","avatar_url":"https://github.com/yihui.png","language":"R","funding_links":["https://github.com/sponsors/yihui"],"categories":["R","Reproducible Research","1. language","Rmarkdown Developer Tools"],"sub_categories":["1.6 R","Medium"],"readme":"# knitr\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/yihui/knitr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/yihui/knitr/actions/workflows/R-CMD-check.yaml)\n[![Check knitr examples](https://github.com/yihui/knitr/actions/workflows/knitr-examples.yaml/badge.svg)](https://github.com/yihui/knitr/actions/workflows/knitr-examples.yaml)\n[![Codecov test coverage](https://codecov.io/gh/yihui/knitr/branch/master/graph/badge.svg)](https://app.codecov.io/gh/yihui/knitr?branch=master)\n[![CRAN release](https://www.r-pkg.org/badges/version/knitr)](https://cran.r-project.org/package=knitr)\n\u003c!-- badges: end --\u003e\n\nEl paquete de R **knitr** es un motor de programación literaria de uso genérico, con una API ligera diseñada para dar a los usuarios control total de la salida sin un trabajo de codificación pesado. Combina muchas características dentro de un paquete con leves ajustes motivados de mi uso diario de Sweave. Observe la [página principal](https://yihui.org/knitr/) del paquete para más detalles y ejemplos. Vea las [FAQ](https://yihui.org/knitr/faq/) para una lista de preguntas frecuentes (que incluye dónde hacer preguntas).\n\n\n## Instalación\n\nPuede instalar la versión estable en [CRAN](https://cran.r-project.org/package=knitr):\n\n```r\ninstall.packages('knitr')\n```\n\nTambién puede instalar la versión en desarrollo desde \u003chttps://yihui.r-universe.dev\u003e, la cual provee construcciones diarias de **knitr**:\n\n```r\noptions(repos = c(\n  yihui = 'https://yihui.r-universe.dev',\n  CRAN = 'https://cloud.r-project.org'\n))\n\ninstall.packages('knitr')\n```\n\n## Motivación\n\nMientras Sweave y paquetes adicionales relacionados como [**cacheSweave**](https://cran.r-project.org/package=cacheSweave) y [**pgfSweave**](https://cran.r-project.org/package=pgfSweave) son motores bastante buenos en programación literaria en R, sin embargo frecuentemente siento que mis manos se cansan, por ejemplo:\n\n- comencé con el código fuente de Sweave y deseé cientos de veces *si solo pudiera insertar fácilmente*  `[width=.8\\textwidth]` *entre* `\\includegraphics` *y* `{my-plot.pdf}` (la manera oficial en Sweave es `\\setkeys{Gin}` pero se ajusta con una amplitud global, la cual no es realista dado que frecuentemente tenemos que fijar la amplitud individualmente; sí, puede usar `\\setkeys{Gin}` muchas veces, pero ¿por qué no proporcionar una sola opción para cada trozo de código?)\n- deseé muchas veces *si tan solo pudiera usar dispositivos gráficos distintos a PDF y postscript*; ahora el sueño se ha vuelto realidad en el R oficial, pero lo que estaba esperando era un opción tan simple como `dev = 'png'` o `dev  = 'CairoJPEG'`\n- deseé que pudiera grabarse múltiples gráficos en un trozo de código en lugar de solo el último de ellos\n- deseé que hubiera una forma de redondear los números en `\\Sexpr{}` diferente a escribir expresiones como `\\Sexpr{round(x, 3)}` para *cada* `\\Sexpr{}`\n- deseé que no tuviera que imprimir (`print()`) gráficos desde [**ggplot2**](https://cran.r-project.org/package=ggplot2) y que un simple `qplot(x, y)` me devolviera un gráfico en Sweave\n- deseé que los usuarios no necesitasen instrucciones sobre `Sweave.sty` o se encontraran con problemas debido al hecho de que LaTeX no encuentra `Sweave.sty`\n- deseé que **cacheSweave** pudiera imprimir los resultados de un trozo de código incluso si este estaba almacenado en caché\n- deseé que [**brew**](https://cran.r-project.org/package=brew) soportase gráficos\n- deseé que [**R2HTML**](https://cran.r-project.org/package=R2HTML) soportase el resaltado de sintaxis de código R\n- ...\n\n[\u003cimg src=\"http://i.imgur.com/yYw46aF.jpg\" align=\"right\" alt=\"The book Dynamic Documents with R and knitr\" /\u003e](https://www.amazon.com/dp/1498716962/)\n\nEl paquete **knitr** se diseñó para dar al usuario acceso a todas las partes del proceso de lidiar con un documento de programación literaria, de forma que no haya necesidad de modificar cualquiera de los componentes centrales si quiere mayor libertad. He estudiado el código fuente de **pgfSweave** y **cacheSweave** un par de veces, y frecuentemente me siento incómodo con la gran cantidad de código copiado del R oficial, especialmente cuando R tiene una nueva versión liberada (empezaré a preocuparme si los paquetes adicionales todavía están actualizados respecto al Sweave ocifial).\n\n\n## Uso \n\n```r\nlibrary(knitr)\n?knit\nknit(input)\n```\n\nIf options are not explicitly specified, **knitr** will try to guess\nreasonable default settings. A few manuals are available such as the [main\nmanual](https://yihui.org/knitr/demo/manual/), and the\n[graphics\nmanual](https://yihui.org/knitr/demo/graphics/). For a\nmore organized reference, see the [knitr book](https://www.amazon.com/dp/1498716962/).\n\nSi no se especifican opciones explícitamente, **knitr** tratará de suponer una configuración por defecto razonable. Hay disponibles unos pocos manuales, tales como el [manual principal](https://yihui.org/knitr/demo/manual/) y el [manual de gráficos](https://yihui.org/knitr/demo/graphics/). Para una referencia más organizada, vea el libro de [knitr](https://www.amazon.com/dp/1498716962/).\n\n\n## Licencia\n\nEste paquete es software libre y de código abierto, licenciado bajo GPL.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyihui%2Fknitr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyihui%2Fknitr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyihui%2Fknitr/lists"}