spatial_SA: spatial_SA

Description Usage Arguments Value Examples

View source: R/spatial_SA.R

Description

Generates a spatial weights matrix (A) and sp_id (S). User defines units and adjacencies.

Usage

1
spatial_SA(data, var_ccode, threshold = 800L)

Arguments

data

data.frame.

var_ccode

name of the variable that contains the country codes.

threshold

distance in kilometers. By default is 800.

Value

list. Contains database with variable sp_id (S) and matrix A.

Examples

1
2
3
4
5
6
7
8
9
walter <- spduration::add_duration(Walter_2015_JCR,"renewed_war",
                                   unitID = "ccode",
                                   tID = "year",
                                   freq = "year",
                                   ongoing = FALSE)

walter <- spatial_SA(data = walter,
                     var_ccode = "ccode",
                     threshold = 800L)

Nicolas-Schmidt/BayesSPsurv documentation built on Sept. 17, 2021, 8:51 a.m.