Introduction to R notebook

Actually it is an Rmarkdown to compose a work flow like document. Easily changable and transparent tool to edit and run codes in chunks and edit text between them.

It supports
  • different languages: R, python, C++ (Rccp), SQL (later Perl)
  • line by line code running
  • whole chunk code running
  • inteactive graphs
Benefits
  • if a (html) document was already make it is not neccesary to rerun all document all the code chunks if some code changed with preview -->easy to iterate codes and text with generated document with preview
  • a rendered html document can viewed in editor like original Rmd file
  • there are less tradeoffs than with Jupyter notebook that support R as well
  • usefull to see the result of a chunk
Disadvantages
  • cannot enter tex like equations (yet)
  • the rendered document is a static html so uploaded data file cannot be used (yet)

And how to start?

Just use this head below as Rmd file head. This code means a notebook format to RStudio and if you want to make an html document the "html_document" section is used.

---
title: "xy"
output:
  html_notebook: default
  html_document:
    highlight: textmate
    theme: spacelab
    toc: yes
---

Or just use R notebook button in RStudio when start a document (Version 0.99.1289, RStudio Preview)

Be sure you have R version 3.3 (or higher) for proper work. And need some packages to update.

Be happyR!

See also:
https://www.rstudio.com/resources/webinars/introducing-notebooks-with-r-markdown/
http://rmarkdown.rstudio.com/r_notebooks.html
https://www.rstudio.com/products/rstudio/download/preview/

No comments:

Post a Comment