Learn R Programming

ssMRCD (version 1.1.0)

groups_gridbased: Creates Grid-Based Neighborhood Structure

Description

This function creates a grid-based neighborhood structure for the ssMRCD function using cut-off values for two coordinate axis.

Usage

groups_gridbased(x, y, cutx, cuty)

Value

Returns a neighborhood assignment vector for the coordinates x and y.

Arguments

x

vector of first coordinate of data set.

y

vector of second coordinate of data set.

cutx

cut-offs for first coordinate.

cuty

cut-offs for second coordinate.

Examples

Run this code
# get data
data(weatherAUT2021)

# set cut-off values
cut_lon = c(9:16, 18)
cut_lat = c(46, 47, 47.5, 48, 49)

# create neighborhood assignments
groups_gridbased(weatherAUT2021$lon,
                      weatherAUT2021$lat,
                      cut_lon,
                      cut_lat)

Run the code above in your browser using DataLab