R-pandoc

[ bsd3, library, program, text ] [ Propose Tags ] [ Report a vulnerability ]

A pandoc filter to express R plots inside markdown


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1, 0.2, 0.2.1, 0.2.2, 0.2.3
Dependencies base (>=4.6 && <5), directory (>=1.2 && <1.4), filepath (>=1.3 && <1.5), pandoc-types (>=1.12 && <1.18), process (>=1.2 && <1.7), R-pandoc (==0.2.3), split (>=0.2 && <0.3) [details]
License BSD-3-Clause
Author Corentin Dupont
Maintainer corentin.dupont@gmail.com
Category Text
Bug tracker http://github.com/cdupont/R-pandoc/issues
Source repo head: git clone http://github.com/cdupont/R-pandoc.git
Uploaded by CorentinDupont at 2019-11-15T18:18:24Z
Distributions
Executables R-pandoc
Downloads 3677 total (16 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2019-11-15 [all 1 reports]

Readme for R-pandoc-0.2.3

[back to package description]

Build Status

A pandoc filter to embbed R plots inside markdown documents.

See the Blog post for more details on usage.

Usage

Install R:

sudo apt-get install r-base

Create a file called demo.md with the following text:

Here is a nice plot:
    ~~~ {.Rplot}
    require(stats)
    D = 150
    T = 10
    t = seq(0, 80, 0.01)
    x = -D*exp(-(t/T))+D
    v = (D/T)*exp(-(t/T))
    plot(t, x, type="l", main="position through time", xlab="time (s)", ylab="position (m)", xlim=c(0,80), ylim=c(0, D+10),  xaxs = "i", yaxs = "i")
    ~~~

Now run:

    pandoc -t html demo.md --filter R-pandoc -o demo.html -s

The file demo.html should now have a nice plot included:

plot

Details

R-pandoc compiles code blocks containing R plots and includes the resulting images in the pandoc markup. It is meant to be run as a pandoc filter as shown above.

Installing

    git clone https://github.com/cdupont/R-pandoc.git
    cd R-pandoc
    stack install