ssh.data.shp: Prepare shapefile data for Geodetector

View source: R/ssh.data.shp.r

ssh.data.shpR Documentation

Prepare shapefile data for Geodetector

Description

Join a candidate SSH layer to an existing layer for the geographical detector model.

Usage

ssh.data.shp(object,
       ssh.lyr,
       ssh.id,
       ssh.name=NULL)

Arguments

object

A point sf object to be joint. Its geometry should be consistent with the sampling layer, but it may have additional attributes from the SSH layer(s).

ssh.lyr

A polygon sf object used as the candidate SSH layer. Its stratum ID will be linked to object.

ssh.id

Text for the field name of stratum ID in the SSH layer.

ssh.name

Text for the new field name assigned to the stratum ID in the output object. If NULL, the attribute name will be the same as that in the old SSH layer.

Value

An sf object with the sampling units and the Strata they fall into.

Examples

library(sf)
library(tools)
data(sim.data)
sim.join <- ssh.data.shp(object=sim.data[[1]], ssh.lyr=sim.data[[2]], ssh.id="X")
head(sim.join)


sandwichr documentation built on April 27, 2023, 1:10 a.m.