threshold_filter: Filter data frames with custom predicates

View source: R/analysis-functions.R

threshold_filterR Documentation

Filter data frames with custom predicates

Description

[Deprecated] This function is deprecated and it's likely going to be dropped in the next release cycle.

Filter a single data frame or a list of data frames with custom predicates assembled from the function parameters.

Usage

threshold_filter(x, threshold, cols_to_compare = "Value", comparators = ">")

Arguments

x

A data frame or a list of data frames

threshold

A numeric/integer vector or a named list of numeric/integer vectors

cols_to_compare

A character vector or a named list of character vectors

comparators

A character vector or a named list of character vectors. Must be one of the allowed values between c("<", ">", "==", "!=", ">=", "<=")

Value

A data frame or a list of data frames

See Also

Other Data cleaning and pre-processing: aggregate_metadata(), aggregate_values_by_key(), compute_near_integrations(), default_meta_agg(), outlier_filter(), outliers_by_pool_fragments(), purity_filter(), realign_after_collisions(), remove_collisions()

Examples

## Not run: 
example_df <- tibble::tibble(
    a = c(20, 30, 40),
    b = c(40, 50, 60),
    c = c("a", "b", "c"),
    d = c(3L, 4L, 5L)
)
example_list <- list(
    first = example_df,
    second = example_df,
    third = example_df
)

filtered <- threshold_filter(example_list,
    threshold = list(
        first = c(20, 60),
        third = c(25)
    ),
    cols_to_compare = list(
        first = c("a", "b"),
        third = c("a")
    ),
    comparators = list(
        first = c(">", "<"),
        third = c(">=")
    )
)
filtered

## End(Not run)

calabrialab/ISAnalytics documentation built on Nov. 2, 2023, 8:57 p.m.