hrbrmstr / freebase

👃🏽A 'usethis'-like Package for Base R Pseudo-equivalents of 'tidyverse' Code
https://hrbrmstr.github.io/freebase/index.html
Other
83 stars 7 forks source link

{tbltools} #15

Closed mkearney closed 5 years ago

mkearney commented 5 years ago

I'm not sure if this is useful, but I thought I'd point out that my {tbltools} package has recently turned into a {dplyr}-lite type of package–similar to {noplyr} only without the {rlang} dependency and a {dplyr_verb}_data naming convention.

noplyr:

> library(magrittr)
> mtcars %>%
+   noplyr::filter(mpg > 11) %>%
+   noplyr::group_by(cyl) %>%
+   noplyr::mutate(n = length(gear)) %>%
+   noplyr::summarize(
+     n = unique(n),
+     mpg = mean(mpg)
+   ) %>%
+   noplyr::arrange(mpg) %>%
+   noplyr::select(cyl, mpg, n)
  cyl      mpg  n
1   4 26.66364 11
2   6 19.74286  7
3   8 15.88333 12

tbltools:

> library(magrittr)
> mtcars %>%
+   tbltools::filter_data(mpg > 11) %>%
+   tbltools::group_data(cyl) %>%
+   tbltools::mutate_data(n = length(gear)) %>%
+   tbltools::summarise_data(
+     n = unique(n),
+     mpg = mean(mpg)
+   ) %>%
+   tbltools::arrange_data(mpg) %>%
+   tbltools::select_data(cyl, mpg, n)
  cyl      mpg  n
1   4 26.66364 11
2   6 19.74286  7
3   8 15.88333 12
hrbrmstr commented 5 years ago

oooh! that is highly useful!

hrbrmstr commented 5 years ago

zomgosh no name collisions and super fast load time! this will be getting a great deal of use, sir!

mkearney commented 5 years ago

Excellent! Will probably make a number of more changes (tests, fixes, and joins) in the next few days!

yonicd commented 5 years ago

After chats with @mkearney and @krlmlr in Austin

Small update to noplyr

Renamed package to bplyr (base + dplyr/tidyr), with trailing prefix on all functions b_*, to resolve NS conflicts with origin pkgs.

https://github.com/yonicd/bplyr