A thorough revision of the package. Please read the first two points: with the default settings, results differ from those of earlier versions.
std = "global"). Earlier versions divided the TPI of each
cell by the standard deviation of elevation in its own neighbourhood; this
is still available with std = "local". In nearly flat areas the local
standardisation turns small irregularities of the DTM into large
standardised values, so that plains may be classified as a mosaic of
valleys and ridges; on perfectly flat areas it is undefined.centre = FALSE), in line with the definition of TPI as the difference
between a cell and its surroundings. With global standardisation this has no
effect away from the edges.std = "local", centre = TRUE, apart from the two fixes below.NA cells), where
slope cannot be computed, were left unclassified only when their TPI was
close to zero, which biased the class frequencies. They are now consistently
left unclassified.terra::cellSize(), and are therefore
correct also for longitude/latitude rasters.pad from the internal calls to terra::focal(); it
belongs to raster::focal() and is rejected by recent versions of terra
(reported by Robert J. Hijmans).class.type now gives an error instead of returning NULL.shape, inner), and
sized in cells or in map units (units; metres for longitude/latitude).tpi.thr, lf.thr, slope.thr.tpi(), returning the raw or standardised TPI surface.class_layers(), returning one presence/absence layer per
class.malta_dtm().ln > sn,
single-layer input, thresholds, colours).landform() now returns an object of class "landform" with print(),
summary() and plot() methods, holding the classes as a single
categorical SpatRaster (classes, with class names and colours), the TPI
and slope layers, the descriptive statistics (always computed; now also
with mean elevation and slope per class), the input DTM and the settings.
The list of per-class rasters returned by earlier versions (result$all,
result$Valley, ...) is replaced by result$classes and
class_layers(result); result[["Descriptive Statistics"]] is replaced by
result$stats (or summary(result)).rainbow()). Custom colours via col.leg.pos still accepts the usual keywords).shade = "slope", slope in grey levels from white for flat terrain to
black for the steepest slopes) or a hillshade (shade = "hill"), with the
overlying layer drawn semi-transparently (alpha).plot(x, what = "tpi") maps the standardised TPI surface(s).plot = FALSE suppresses plotting.