mergeIdentLayers: Merge layers with identical properties

Description Usage Arguments Value Author(s) Examples

View source: R/mergeIdentLayers.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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 Dec. 3, 2020, 9:08 a.m.