R Markdown

Kyso is also designed for R users to also be able to publish their data-science reports.

When posting R markdown (.rmd, or .Rmd files) to Kyso you will need to convert them to normal markdown (.md) files before they hit Kyso. That can be before you upload them, or before you commit them to your Github repository.

When you convert Rmd to normal markdown it will create run the code in the Rmd file, generate any images and tables needed, create a markdown file and an assets folder for any image files. You can them upload the markdown and assts folder to Kyso.

Converting R to other formats

Installing knitr

Knitr is the package that we will use to convert the Rmd files to markdown in order to upload to Kyso, lets install it first using inside your R console:

install.packages("knitr")

Using the command line

In the directory of your .Rmd file just use the following command:

Rscript -e "library(knitr); knit('notebook.Rmd', 'notebook.md')"

Using R Studio

Make sure you set the working directory to the location of your .Rmd files.

R Studio Interface

Once you have your working directory set go to your R console inside R studio and enter the following commands, first to load knitr and then to convert the notebook:

library(knitr)
knit('notebook.Rmd', 'notebook.md')
Compiling R markdown to markdown

Posting to Kyso

Then simply upload the generated files to Kyso, or commit them to your Github repo which is connected to Kyso. Be sure to select the generated .md file as the main file, not the .Rmd

Compiling R to HTML

Soon Kyso will also facilitate the posting of raw HTML files, which means R users will be able to compile their scripts to HTML. This will benefit those who like to work with interactive graphing libraries like plotly and bokeh.