as.s2im.function: Convert Function on the Sphere to an Image/Raster on the...

View source: R/s2im.R

as.s2im.functionR Documentation

Convert Function on the Sphere to an Image/Raster on the Sphere

Description

Convert Function on the Sphere to an Image/Raster on the Sphere

Usage

as.s2im.function(f, region = NULL, ..., level = NULL)

Arguments

f

function of degrees longitude and latitude in that order.

region

Object of class s2region where the function should be evaluated.

...

Ignored.

level

Integer level of the pixels between 0 (each pixel is huge – millions of square kilometres on Earth) and 30 (each pixel is tiny – approximately a square cm on Earth).

Value

Object of class s2im.

Examples

poly <- s2polygon(cbind(lon = c(-20,-10,10,20,10,-10), lat = c(0, -10, -10, 0, 10, 10)))
f <- function(lon, lat){ sin(lon) }
im <- as.s2im.function(f, poly, level = 6)
plot(im)

spatstat/spatstat.sphere documentation built on Jan. 27, 2023, 2:59 a.m.