mergeIdentLayers: Merge layers with identical properties

View source: R/mergeIdentLayers.R

mergeIdentLayersR Documentation

Merge layers with identical properties

Description

Merge adjacent layers that have identical properties, such as grain type, hardness etc..

Usage

mergeIdentLayers(x, properties = c("hardness", "gtype"))

Arguments

x

a snowprofile or snowprofileLayers object with height grid information

properties

a character array of layer properties that are considered when searching for identical layers (e.g., hardness, gtype, ...)

Value

A new snowprofileLayers object will be returned with the dimensions height, hardness, gtype and any other properties given in 'properties'. Depth and thickness information will be auto-calculated. For snowprofile objects, the field 'changes' will be initialized or extended.

Author(s)

fherla

Examples


## Merge identical layers based on hardness and grain type:
fewerLayers <- mergeIdentLayers(x = SPpairs$A_modeled, properties = c("hardness", "gtype"))
summary(SPpairs$A_modeled)[, c("hs", "nLayers")]
summary(fewerLayers)[, c("hs", "nLayers")]

## compare profile plots before and after merging (i.e., appear identical!)
opar <- par(no.readonly =TRUE)
par(mfrow = c(1, 2))
plot(SPpairs$A_modeled, main = "original", ylab = "Snow height")
plot(fewerLayers, main = "merged layers", ylab = "Snow height")
par(opar)


sarp.snowprofile.alignment documentation built on Aug. 8, 2022, 1:05 a.m.