Skip to contents

Counts the number of nearest neighbors for each central atom based on a table of bonded pairs.

Usage

calculate_neighbor_counts(bonded_pairs_table)

Arguments

bonded_pairs_table

A data.table of bonded pairs.

Value

A data.table with columns 'Atom' and 'CoordinationNumber'.

Examples

bp <- data.table::data.table(Atom1 = c("Si1", "Si1", "O1"),
                             Atom2 = c("O1", "O2", "Si1"))
calculate_neighbor_counts(bp)
#>      Atom CoordinationNumber
#>    <char>              <int>
#> 1:    Si1                  2
#> 2:     O1                  1