get_adj_mat {BSTZINB} | R Documentation |
Adjacency matrix for counties of one or many states in the United States
Description
Creates the adjacency matrix for the supplied counties within the United States using the available neighborhood information
Usage
get_adj_mat(county.adjacency,Countyvec,Statevec)
Arguments
county.adjacency |
data frame containing the neighborhood information for the counties of the entire US |
Countyvec |
character vector containing the names of the counties for which the adjacency matrix is to be computed |
Statevec |
character vector containing the names of the states the supplied counties belong to |
Value
the corresponding adjacency matrix
Examples
data(county.adjacency)
data(USAcities)
IAcities <- subset(USAcities,state_id=="IA")
countyname <- unique(IAcities$county_name)
A <- get_adj_mat(county.adjacency,countyname,c("IA"))
[Package BSTZINB version 2.0.0 Index]