reactants_in_reaction: Check which species are reactants in a given reaction

View source: R/parser.R

reactants_in_reactionR Documentation

Check which species are reactants in a given reaction

Description

It is used to check which of the given species are reactants in a reaction, returning a vector with the species indexes in species that are reactants in reaction.

Usage

reactants_in_reaction(species, reaction)

Value

A vector filled with indexes specifying the species that are in a reaction as a reactant.

Examples

# Should return c(1, 2)
DNAr:::reactants_in_reaction(c('A', 'B', 'C'), 'A + B -> C')
# Should return c(1)
DNAr:::reactants_in_reaction(c('A', 'B', 'C'), '2A -> B + C')
# Should return c(1, 3)
DNAr:::reactants_in_reaction(c('A', 'B', 'C'), 'A + C -> B')

DanielKneipp/DNAr documentation built on Jan. 7, 2023, 12:42 p.m.