Learn R Programming

BayesSPsurv (version 0.1.4)

spatial_SA: spatial_SA

Description

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

Usage

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

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab