vec2mat: Internal scampr function that converts a vector to matrix...

View source: R/vec2mat.R

vec2matR Documentation

Internal scampr function that converts a vector to matrix given spatial locations. For use in images

Description

Internal scampr function that converts a vector to matrix given spatial locations. For use in images

Usage

vec2mat(vec, x.loc, y.loc)

Arguments

vec

A vector of field values of equal length to locations x.loc and y.loc

x.loc

A vector of horizontal locations in 2D

y.loc

A vector of vertical locations in 2D

Value

a matrix representing the locations of a regular spatial domain

Examples

# Get the quadrature from the gorillas data
quad <- gorillas[gorillas$pres == 0, ]

elevation <- scampr:::vec2mat(vec = quad$elevation, x.loc = quad$x, y.loc = quad$y)
image(elevation, asp = 1)

ElliotDovers/scampr documentation built on March 17, 2024, 3:27 p.m.