Title

R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00

JavaScript

The js4shiny::html_document_js() format enables literate programming with JavaScript. All console.log() outputs are evaluated in the browser and returned within the document when viewed, just like the R code above. Note that the final line doesn’t require an explicit console.log().

app.js
let x = 10
console.log("multiplying x times 10...")
x * 20

JSON

Chunks are color coded according to their type, with colors defined for R, js, json, node, bash, md, and yaml. You can also use the name chunk option to set the name of the chunk, which should be used when the code shown is intended for a particular file.

topAlbums.json
[
  {
      "Artist": "Eagles",
      "Album": "Their Greatest Hits (1971–1975)",
      "Released": 1976,
      "Claimed sales*": 51,
  },
  {
      "Artist": "AC/DC",
      "Album": "Back in Black",
      "Released": 1980,
      "Claimed sales*": 50,
  },
  {
      "Artist": "Pink Floyd",
      "Album": "The Dark Side of the Moon",
      "Released": 1973,
      "Claimed sales*": 45,
  },
]

node, bash, command line

npm run-script build
npm install -g grunt-cli