batchTest: Apply a boolean test to batches of data in an Andromeda table...

View source: R/Operations.R

batchTestR Documentation

Apply a boolean test to batches of data in an Andromeda table and terminate early

Description

Apply a boolean test to batches of data in an Andromeda table and terminate early

Usage

batchTest(tbl, fun, ..., batchSize = 1e+05)

Arguments

tbl

An Andromeda table (or any other 'DBI' table).

fun

A function where the first argument is a data frame and returns a logical value.

...

Additional parameters passed to fun.

batchSize

Number of rows to fetch at a time.

Details

This function applies a boolean test function to sets of data and terminates at the first FALSE.

Value

Returns FALSE if any of the calls to the user-supplied function returned FALSE, else returns TRUE.

Examples

andr <- andromeda(cars = cars)

fun <- function(x) {
  is.unsorted(x %>% select(speed) %>% collect())   
}

result <- batchTest(andr$cars, fun, batchSize = 25)

result
# [1] FALSE 

close(andr)


Andromeda documentation built on Sept. 12, 2024, 7:41 a.m.