Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dreanod/knitxl
An R package to knit Rmd files into xlsx
https://github.com/dreanod/knitxl
Last synced: 8 days ago
JSON representation
An R package to knit Rmd files into xlsx
- Host: GitHub
- URL: https://github.com/dreanod/knitxl
- Owner: dreanod
- License: gpl-3.0
- Created: 2022-10-28T07:33:22.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-09T19:59:41.000Z (4 months ago)
- Last Synced: 2024-11-14T09:42:07.576Z (28 days ago)
- Language: R
- Size: 895 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- jimsghstars - dreanod/knitxl - An R package to knit Rmd files into xlsx (R)
README
# knitxl
[![R-CMD-check](https://github.com/dreanod/knitxl/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/dreanod/knitxl/actions/workflows/R-CMD-check.yaml)
`knitxl` converts an Rmarkdown file into an `.xlsx` file. It uses
[`knitr`](https://yihui.org/knitr/) to parse the Rmd files and evaluate code
chunks. `knitx` comes with features to customize the output `.xlsx` file.## Example
This will convert an `.Rmd` file into an `.xlsx` file:
```r
library(knitxl)
path_to_rmd_file <- system.file("examples/minimal-example.Rmd", package = "knitxl")
knitxl(path_to_rmd_file)
```## Installation
### From CRAN
Most users should install the latest release version of `knitxl` from
[CRAN](https://cran.r-project.org) with:```r
install.packages("knitxl")
```### From GitHub
You can install the development version of knitxl from
[GitHub](https://github.com/) with:``` r
# install.packages("devtools")
devtools::install_github("dreanod/knitxl")
```## How `knitxl` works
`knitxl` relies on [`knitr`](https://yihui.org/knitr/) to parse an `.Rmd` file
and evaluate the code chunks. `knitxl` attaches special
[hooks](https://yihui.org/knitr/hooks/) to `knitr`, which will save the
text, source code, and results of `knitr` evaluation to an `R6` object that
represents the content of an `.xlsx` file.
[`openxlsx`](https://ycphs.github.io/openxlsx/index.html) is used for creating,
writing, styling and saving this object to the `.xlsx` output.