Skip to content

Commit

Permalink
Fix misstatement
Browse files Browse the repository at this point in the history
Closes #50
  • Loading branch information
TysonStanley committed Jan 7, 2024
1 parent f38ff2d commit 9d5a562
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 22 deletions.
6 changes: 6 additions & 0 deletions .dev/dev.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ devtools::document(here::here())
devtools::check(here::here())
# fix github actions
usethis::use_github_action()
# check win-builder
devtools::check_win_devel(here::here())
devtools::check_win_release(here::here())
devtools::check_win_oldrelease(here::here())
# update pkg site
pkgdown::build_site(here::here())
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ set.seed(843)

**Note: The expansion of `dtplyr` has made some of the functionality in `tidyfast` redundant. See `dtplyr` for a list of functions that are handled within that framework.**

The goal of `tidyfast` is to provide fast and efficient alternatives to some `tidyr` (and a few `dplyr`) functions using `data.table` under the hood. Each have the prefix of `dt_` to allow for autocomplete in IDEs such as RStudio. These should compliment some of the current functionality in `dtplyr` (but notably does not use the `lazy_dt()` framework of `dtplyr`). This package imports `data.table` and `Rcpp` (no other dependencies).
The goal of `tidyfast` is to provide fast and efficient alternatives to some `tidyr` (and a few `dplyr`) functions using `data.table` under the hood. Each have the prefix of `dt_` to allow for autocomplete in IDEs such as RStudio. These should compliment some of the current functionality in `dtplyr` (but notably does not use the `lazy_dt()` framework of `dtplyr`). This package imports `data.table` and `cpp11` (no other dependencies).

These are, in essence, translations from a more `tidyverse` grammar to `data.table`. Most functions herein are in places where, in my opinion, the `data.table` syntax is not obvious or clear. As such, these functions can translate a simple function call into the fast, efficient, and concise syntax of `data.table`.

Expand Down Expand Up @@ -457,7 +457,7 @@ head(dt_separate(dt_to_split, x, into = c("lower", "upper")))
```


Testing with a 4 MB data set with one variable that has columns of "A.B" repeatedly, shows that `dt_separate()` is fast but less memory efficient than `tidyr::separate()`.
Testing with a 4 MB data set with one variable that has columns of "A.B" repeatedly, shows that `dt_separate()` is fast and far more memory efficient compared to `tidyr::separate()`.

```{r, echo = FALSE, warning = FALSE}
dt4 <- data.table(
Expand Down
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ some `tidyr` (and a few `dplyr`) functions using `data.table` under the
hood. Each have the prefix of `dt_` to allow for autocomplete in IDEs
such as RStudio. These should compliment some of the current
functionality in `dtplyr` (but notably does not use the `lazy_dt()`
framework of `dtplyr`). This package imports `data.table` and `Rcpp` (no
other dependencies).
framework of `dtplyr`). This package imports `data.table` and `cpp11`
(no other dependencies).

These are, in essence, translations from a more `tidyverse` grammar to
`data.table`. Most functions herein are in places where, in my opinion,
Expand Down Expand Up @@ -244,13 +244,13 @@ highlighted below. Notably, the timings are without the `nested1` and
#> # A tibble: 2 × 3
#> expression median mem_alloc
#> <chr> <bch:tm> <bch:byt>
#> 1 dt_nest 1.15ms 2.88MB
#> 2 group_nest 1.93ms 5.12MB
#> 1 dt_nest 1.16ms 2.88MB
#> 2 group_nest 1.94ms 5.12MB
#> # A tibble: 2 × 3
#> expression median mem_alloc
#> <chr> <bch:tm> <bch:byt>
#> 1 dt_unnest 2.04ms 11.84MB
#> 2 unnest 2.31ms 5.96MB
#> 1 dt_unnest 2.22ms 11.84MB
#> 2 unnest 2.38ms 5.96MB

## Pivoting

Expand Down Expand Up @@ -325,10 +325,10 @@ But let’s compare some basic speed and efficiency. Because of the
#> # A tibble: 4 × 3
#> expression median mem_alloc
#> <chr> <bch:tm> <bch:byt>
#> 1 dt_pivot_longer 366.17µs 1001.23KB
#> 2 pivot_longer 1.95ms 1.73MB
#> 3 dt_pivot_wider 5.54ms 1.99MB
#> 4 pivot_wider 3.81ms 2.71MB
#> 1 dt_pivot_longer 360.92µs 1001.23KB
#> 2 pivot_longer 1.93ms 1.73MB
#> 3 dt_pivot_wider 5.62ms 1.99MB
#> 4 pivot_wider 3.96ms 2.71MB

### If Else

Expand Down Expand Up @@ -377,9 +377,9 @@ built on `data.table::fifelse()`.
#> # A tibble: 3 × 3
#> expression median mem_alloc
#> <chr> <bch:tm> <bch:byt>
#> 1 case_when 45.2ms 72.5MB
#> 2 dt_case_when 10.7ms 19.1MB
#> 3 fifelse 19.9ms 34.3MB
#> 1 case_when 44.9ms 72.5MB
#> 2 dt_case_when 10.6ms 19.1MB
#> 3 fifelse 20ms 34.3MB

## Fill

Expand Down Expand Up @@ -492,8 +492,8 @@ marks3 <-
#> # A tibble: 2 × 3
#> expression median mem_alloc
#> <bch:expr> <bch:tm> <bch:byt>
#> 1 tidyr::fill(dplyr::group_by(df3, id), x, y) 15.6ms 46.4MB
#> 2 tidyfast::dt_fill(dt3, x, y, id = list(id)) 12.6ms 17.6MB
#> 1 tidyr::fill(dplyr::group_by(df3, id), x, y) 15.9ms 46.4MB
#> 2 tidyfast::dt_fill(dt3, x, y, id = list(id)) 12.7ms 17.6MB

## Separate

Expand Down Expand Up @@ -528,17 +528,17 @@ dt_separate(dt_to_split, x, into = c("lower", "upper"))
#> 6: f F

Testing with a 4 MB data set with one variable that has columns of “A.B”
repeatedly, shows that `dt_separate()` is fast but less memory efficient
than `tidyr::separate()`.
repeatedly, shows that `dt_separate()` is fast and far more memory
efficient compared to `tidyr::separate()`.

<img src="man/figures/README-unnamed-chunk-21-1.png" width="70%" />

#> # A tibble: 3 × 3
#> expression median mem_alloc
#> <chr> <bch:tm> <bch:byt>
#> 1 separate 2.78s 3.89GB
#> 2 dt_separate 47.91ms 26.73MB
#> 3 dt_separate-mutable 47.51ms 26.72MB
#> 1 separate 2.76s 3.89GB
#> 2 dt_separate 46.59ms 26.73MB
#> 3 dt_separate-mutable 46.47ms 26.72MB

## Count and Uncount

Expand Down
Binary file modified man/figures/README-third_pivot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-third_pivot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-13-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-16-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-21-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-25-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-9-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9d5a562

Please sign in to comment.