interpola {rainfarmr}R Documentation

Interpolate field using nearest neighbors

Description

Interpolates a square input matrix to a finer resolution ns using nearest neighbours.

Usage

interpola(z, ns)

Arguments

z

matrix containing the input field at coarse resolution.

ns

the target size.

Value

The resulting fine-scale field with dimensions c(ns, ns).

Author(s)

Jost von Hardenberg, j.vonhardenberg@isac.cnr.it

Examples

za <- rnorm(4 * 4)
dim(za) <- c(4, 4)
z <- interpola(za, 16)
dim(z)
# [1] 16 16

[Package rainfarmr version 0.1 Index]