ComparisonOperator: Create a Comparison Search Operator

View source: R/TextOperators.R

ComparisonOperatorR Documentation

Create a Comparison Search Operator

Description

Constructs a 'ComparisonOperator' object for search operations that perform comparison checks on attribute values. This operator allows for evaluating attributes using comparison operators such as 'equal', 'greater_than', or 'less_than', making it suitable for numerical and date-based searches.

Usage

ComparisonOperator(attribute, value, comparison_type)

Arguments

attribute

The attribute to be compared. This should be the field within the RCSB PDB that you want to evaluate.

value

The value to compare against. This is the reference value for the comparison.

comparison_type

A string specifying the type of comparison (e.g., 'equal', 'greater_than', 'less_than'). Supported comparison types are 'equal', 'not_equal', 'greater_than', 'less_than', etc.

Value

An object of class 'ComparisonOperator' that can be used in search queries to retrieve entries where the attribute meets the specified comparison criteria.

Examples

# Search for entries where an attribute equals a specific value
operator <- ComparisonOperator(attribute = "rcsb_entry_info.resolution_combined",
                                value = 2.0, comparison_type = "EQUAL")
operator

rPDBapi documentation built on Sept. 11, 2024, 6:37 p.m.