Learn R Programming

BSTZINB (version 2.0.1)

get_adj_mat: 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)

Value

the corresponding adjacency matrix

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

Examples

Run this code
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"))

Run the code above in your browser using DataLab