filter_split {hacksaw}R Documentation

Perform various operations before splitting

Description

Evaluate expressions over a data frame, resulting in a list.

Usage

filter_split(.data, ...)

select_split(.data, ...)

count_split(.data, ...)

mutate_split(.data, ...)

distinct_split(.data, ..., simplify = TRUE)

transmute_split(.data, ..., simplify = TRUE)

slice_split(.data, ...)

pull_split(.data, ...)

group_by_split(.data, ...)

eval_split(.data, ...)

precision_split(.data, ...)

Arguments

.data

A table of data.

...

Expressions to be evaluated.

simplify

Boolean, whether to unlist the returned split.

Value

A list.

Examples

library(dplyr)
mtcars %>% filter_split(cyl == 4, cyl == 6)
iris %>% select_split(starts_with("Sepal"), starts_with("Petal"))
mtcars %>% count_split(gear, carb, across(c(cyl, gear)))
mtcars %>% mutate_split(mpg2 = mpg^2, mpg3 = mpg^3)
mtcars %>% distinct_split(cyl, carb)
mtcars %>% transmute_split(mpg^2, sqrt(mpg))
mtcars %>% slice_split(1:10, 11:20)
mtcars %>% pull_split(mpg, hp)
mtcars %>% group_by_split(cyl, gear, across(c(cyl, gear)))
mtcars %>% eval_split(select(mpg, hp), filter(mpg>25), mutate(mpg2 = mpg^2))
mtcars %>% precision_split(mpg > 25)

[Package hacksaw version 0.0.2 Index]