RangeOperator: Create a Range Search Operator

View source: R/TextOperators.R

RangeOperatorR Documentation

Create a Range Search Operator

Description

Constructs a 'RangeOperator' object for search operations that specify a range for attribute values. This operator is particularly useful for filtering results based on numeric or date ranges, such as finding entries with resolution between specific values or dates within a certain range.

Usage

RangeOperator(
  attribute,
  from_value,
  to_value,
  include_lower = TRUE,
  include_upper = TRUE,
  negation = FALSE
)

Arguments

attribute

The attribute to be evaluated within a range. This should be the numeric or date field within the RCSB PDB that you want to search against.

from_value

The starting value of the range. This is the lower bound of the range.

to_value

The ending value of the range. This is the upper bound of the range.

include_lower

Boolean indicating whether to include the lower bound in the range. Default is TRUE.

include_upper

Boolean indicating whether to include the upper bound in the range. Default is TRUE.

negation

Boolean indicating whether to negate the range condition. Default is FALSE.

Value

An object of class 'RangeOperator' that can be used in search queries to retrieve entries where the attribute falls within the specified range.

Examples

# Search for entries within a specific range of resolution
operator <- RangeOperator(attribute = "rcsb_entry_info.resolution_combined",
                          from_value = 1.5, to_value = 2.5)
print(operator)

rPDBapi documentation built on Oct. 19, 2024, 5:08 p.m.