from_xyz: Derive a grid from XYZ points

View source: R/from_xyz.R

from_xyzR Documentation

Derive a grid from XYZ points

Description

This function is very liberal, it simply finds unique x values and unique y values, sorts them and finds the minimum difference between the points, then checks that rounded ratio of differences to this minimum is 1.

Usage

from_xyz(xyz, digits = 5)

Arguments

xyz

set of points xy or xyz (matrix or data frame)

digits

argument passed to round()

Details

The points can be the full grid set, a partial set, or a superset of the grid. The resolution will simply be the smallest actual difference found. (Zero is not possible because we sort(unique(...))).

The z-column if present is ignored.

Value

list with elements 'dimension', 'extent'

Examples

from_xyz(vaster_long(c(10, 5), c(0, 10, 0, 5)))

hypertidy/vaster documentation built on June 10, 2025, 8:09 a.m.