use_tidyjs | R Documentation |
Adds the HTML dependencies required for tidy.js.
use_tidyjs(minified = TRUE, remote = FALSE)
html_dependency_tidyjs(minified = TRUE, remote = FALSE)
html_dependency_d3_array(minified = TRUE, remote = FALSE)
minified |
Use the minified JavaScript files |
remote |
When |
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 echo=FALSE} tidyjs::use_tidyjs() ``` ```{js} 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')) ) ```
use_tidyjs()
: Add the tidy.js
and dependencies to your document
or app
html_dependency_tidyjs()
: The tidy.js
dependency
html_dependency_d3_array()
: The d3-array
dependency
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.