1.0.0 • Published 2 years ago

rnotebook v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

rnotebook

Creates R Markdown(.rmd) files. R Markdown is R's equivalent to IPython Notebooks.

Construct rnotebook

rnotebook is entirely a class. Construct it by running:

var notebook = new Notebook();

Add Markdown

Adding Markdown is simple. Add it by running:

notebook.addMarkdown(`# Hello, World!
- Hello
- World
`);

Add R Code

Again, adding code is simple. Add R code by running:

notebook.addRCode(`library(ggplot2)
ggplot(data.frame(x=1:10, y=1:10), aes(x, y)) + geom_point()`);

Retrieve the .rmd file (as a string)

In the class, internally it just appends to a string. So you just have to get the string. You can do that by:

notebook.notebook; /*
# Hello, World!
- Hello
- World

<!-- stripped R code due to this documentation's markdown -->
*/