check_parentheses_balance: Verify if parentheses in the equation are properly balanced

View source: R/05_01_validate_model_input.R

check_parentheses_balanceR Documentation

Verify if parentheses in the equation are properly balanced

Description

This function checks if all parentheses in a given equation string are correctly paired and balanced. If there are no parentheses, the equation is considered trivially balanced. It returns 'TRUE' if the parentheses are balanced and 'FALSE' otherwise.

Usage

check_parentheses_balance(eq)

Arguments

eq

A character string representing an equation.

Value

A logical value indicating whether the parentheses are balanced ('TRUE') or not ('FALSE').


gamrot/godley documentation built on April 12, 2025, 1:50 p.m.