https://github.com/asardaes/table.express
Use dplyr verbs to build data.table expressions
https://github.com/asardaes/table.express
Last synced: 5 months ago
JSON representation
Use dplyr verbs to build data.table expressions
- Host: GitHub
- URL: https://github.com/asardaes/table.express
- Owner: asardaes
- License: mpl-2.0
- Created: 2019-05-06T06:21:17.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-04T10:44:01.000Z (about 2 years ago)
- Last Synced: 2024-11-13T14:54:13.452Z (5 months ago)
- Language: R
- Homepage: https://asardaes.github.io/table.express/
- Size: 907 KB
- Stars: 65
- Watchers: 3
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - asardaes/table.express - Use dplyr verbs to build data.table expressions (R)
README
---
output:
md_document:
variant: gfm
editor_options:
chunk_output_type: console
---```{r setup, cache = FALSE, include = FALSE}
library(knitr)
library(data.table)
library(table.express)
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-",
cache = FALSE
)
```[](https://cran.r-project.org/package=table.express)
[](https://github.com/asardaes/table.express/actions)
[](https://codecov.io/gh/asardaes/table.express)# Table express
Use `dplyr` verbs, as well as custom ones, to build `data.table` expressions.
Check the [vignette](https://asardaes.github.io/table.express/articles/table.express.html) for more information.## Essence
The basic idea is to parse the input from all the verbs and create a single expression that, after evaluation,
simply delegates all the actual computations to `data.table`,
letting it handle all optimizations as usual.```{r essence}
# the expression is what matters here, input is left empty
data.table() %>%
start_expr %>%
select(col) %>%
where(var == val) %>%
order_by(v)
```The input `data.table` is always assigned in the evaluation's environment as the `.DT_` pronoun
In many cases character input can also be supported,
which could be useful for other packages that use `data.table`.## License
[Mozilla Public License Version 2.0](LICENSE)
This software package was developed independently of any organization or institution that is or has been associated with the author.