Learn R Programming

rainfarmr (version 0.1)

interpola: 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).

Examples

Run this code
# NOT RUN {
za <- rnorm(4 * 4)
dim(za) <- c(4, 4)
z <- interpola(za, 16)
dim(z)
# [1] 16 16
# }

Run the code above in your browser using DataLab