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)

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().

```{js, name="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.

```{json, name="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


gadenbuie/js4shiny documentation built on March 25, 2024, 8:16 p.m.