To use tidy.js
in your R Markdown documents, call [use_tidyjs()]. You can then
access tidy functions from the Tidy
object in your Shiny App or in your
R Markdown document inside a JavaScript (js
) chunk:
```r`r ''` tidyjs::use_tidyjs() ``` ```{js}`r ''` const { tidy, mutate, arrange, desc } = Tidy; const data = [ { a: 1, b: 10 }, { a: 3, b: 12 }, { a: 2, b: 10 } ] const results = tidy( data, mutate({ ab: d => d.a * d.b }), arrange(desc('ab')) ) ```
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.