Create and Preview RMarkdown Documents with QBit Workspace
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Create and Preview RMarkdown Documents with QBit Workspace
RMarkdown is an excellent format to create documents which combine code outputs with text—a programming paradigm called Literate Programming first introduced by Donald Knuth. Although RMarkdown documents are mostly used by the R community, preferably within the RStudio IDE, the format is not restricted to the R language. Also other language engines like Python, SQL or Julia can be used with RMarkdown. The current knitr package version 1.33 lists even 44 available engines:
names(knitr::knit_engines$get()) [1] "awk" "bash" "coffee" "gawk" "groovy" [6] "haskell" "lein" "mysql" "node" "octave" [11] "perl" "psql" "Rscript" "ruby" "sas" [16] "scala" "sed" "sh" "stata" "zsh" [21] "highlight" "Rcpp" "tikz" "dot" "c" [26] "cc" "fortran" "fortran95" "asy" "cat" [31] "asis" "stan" "block" "block2" "js" [36] "css" "sql" "go" "python" "julia" [41] "sass" "scss" "R" "bslib"
Thanks to the pandoc document converter RMarkdown also supports many different output formats which can be set with the output
parameter in the YAML header, including:
-
HTML: Static HTML files
output: html_document
-
PDF: PDF Documents generated through Latex,
output: pdf_document
-
Word: Microsoft Word documents,
output: word_document
-
Presentations: Presentation formats like MS Powerpoint
output: powerpoint_presentation
-
Dashboards: flexdashboard
output: flexdashboard::flex_dashboard
QBits Workspace facilitates the authoring of RMarkdown documents directly within the browser thanks to instant previews in the Viewer pane. The instant preview functionality leads to faster development of RMarkdown documents. See below a short presentation of how RMarkdown authoring works:
Create New RMarkdown Document
In the Workspaces Section section of your Dashboard you can create a New Workspace, enter its name and select the RMarkdown template:
Create HTML Document
Set output: html_document
in the YAML header of the document and hit the Render button:
Create PDF Document
Set output: pdf_document
and Render:
Create Word Document
Set output: word_document
and Render:
Create Powerpoint Presentation
Set output: powerpoint_presentation
and Render:
RMarkdown Example Powerpoint document
Give it a try by either creating a new workspace from scratch or by copying one of the existing QBit Workspace examples.
Happy reporting, feedback welcome! ✌️
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.