An open API service indexing awesome lists of open source software.

https://github.com/kdm9/xspin

hacks around knitr::spin() for shell and python scripts
https://github.com/kdm9/xspin

Last synced: 2 months ago
JSON representation

hacks around knitr::spin() for shell and python scripts

Awesome Lists containing this project

README

        

# xspin

[![R-CMD-check](https://github.com/kdm9/xspin/workflows/R-CMD-check/badge.svg)](https://github.com/kdm9/xspin/actions)

A version of knitr::spin() which functions on languages other than R. Now one
can spin() a python/shell/R script to a .Rmd, and compile outputs from there.

## Installation

You can install the development version of xspin like so:

```r
remotes::install("kdm9/xspin")
```

## Example

```r
# "spin" script to notebook
xspin::xspin(input="script.sh", output="script.Rmd")

# a one-stop-shop: xspin() followed by rmarkdown::render().
xspin::xweave(input="script.sh")
```

See [the test py/sh files](tests/testthat/data/) for example inputs and expected Rmd outputs.