Skip to contents

Binary weights linking every pair of distinct units sharing a group, as spdep::nb2blocknb without prior neighbours.

Usage

BlockWeights(groups)

Arguments

groups

Group label of each unit.

Value

Binary matrix.

Examples

BlockWeights(c("a", "b", "a"))
#>      [,1] [,2] [,3]
#> [1,]    0    0    1
#> [2,]    0    0    0
#> [3,]    1    0    0