Learn R Programming

aNCA (version 0.1.0)

apply_filters: Apply Filters to a Dataset

Description

This function applies a set of filters to a dataset. Each filter specifies a column, condition, and value to filter the dataset.

Usage

apply_filters(data, filters)

Value

A data frame containing the filtered data.

Arguments

data

A data frame containing the raw data to be filtered.

filters

A list of filters, where each filter is a list containing the column, condition, and value.

Details

The function iterates over the list of filters and applies each filter to the dataset. The supported conditions are ==, >, <, >=, <= and !=.

Examples

Run this code
# Example usage:
data <- mtcars
filters <- list(
  list(column = "mpg", condition = ">", value = "20"),
  list(column = "cyl", condition = "==", value = "6")
)
filtered_data <- apply_filters(data, filters)

Run the code above in your browser using DataLab