Learn R Programming

divseg (version 0.1.0)

ds_dd_interaction: Compute Distance Decay Interaction

Description

Compute Distance Decay Interaction

Usage

ds_dd_interaction(.data, .cols, .name, .comp = FALSE)

dd_interaction(..., .data = dplyr::across(everything()))

Value

a tibble or numeric vector if .name missing

Arguments

.data

tibble with sf geometry

.cols

tidy-select Columns to compute the measure with. Must be at least 2 columns. If more than 2, treats first column as first group and sum of other columns as second.

.name

name for column with distance decay interaction. Leave missing to return a vector.

.comp

Default is FALSE. FALSE returns the sum, TRUE returns the components.

...

arguments to forward to ds_dd_interaction from dd_interaction

Examples

Run this code
data('de_county')
ds_dd_interaction(de_county, c(pop_black, starts_with('pop_')))
ds_dd_interaction(de_county, c(pop_black, starts_with('pop_')), 'dd_interaction')

Run the code above in your browser using DataLab