xyindex_to_nindex: Convert XY coordinates to a value index for a matrix

View source: R/Spatial utilities.R

xyindex_to_nindexR Documentation

Convert XY coordinates to a value index for a matrix

Description

This function converts a double index for a matrix (xy) into a single index for values. This allows vectorised subsetting of incomplete rows and columns.

Usage

xyindex_to_nindex(x, y, nrow)

Arguments

x

vector of row numbers for target values.

y

vector of column numbers for target values.

nrow

The number of rows in the matrix

Value

A vector of indices for values in a matrix.

See Also

Other NEMO-MEDUSA spatial tools: calculate_depth_share(), calculate_proximity_weight(), netcdf_scheme_helpers, scheme_column(), scheme_interp_slice(), scheme_strathE2E(), stratify(), voronoi_grid()


Jack-H-Laverick/nemomedusR documentation built on Dec. 12, 2022, 5:21 a.m.