Skip to content

gadenbuie/tidyjs-r

Repository files navigation

tidyjs

Tidy up your data with JavaScript for R users. Bring tidy.js to your R Markdown HTML documents or Shiny apps.

Be sure to check out the tidy.js homepage or GitHub repo at pbeshai/tidy.

Installation

You can install the released version of tidyjs from GitHub:

# install.packages("remotes")
remotes::install_github("gadenbuie/tidyjs-r")

Usage

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'))
)
```

Check out tidy.js in action in the interactive README.

About

Tidy Data with JavaScript and tidy.js

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Languages